Skip to content

Commit 7233466

Browse files
JoseExpositospbnick
authored andcommitted
HID: uclogic: Checkpatch fixes
Fixes minor style issues reported by checkpatch and already fixed upstream. Signed-off-by: José Expósito <jose.exposito89@gmail.com>
1 parent a62702f commit 7233466

2 files changed

Lines changed: 26 additions & 34 deletions

File tree

hid-uclogic-core.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,8 @@ static int uclogic_input_configured(struct hid_device *hdev,
144144
* Disable EV_MSC reports for touch ring interfaces to
145145
* make the Wacom driver pickup touch ring extents
146146
*/
147-
if (frame->touch_byte > 0) {
147+
if (frame->touch_byte > 0)
148148
__clear_bit(EV_MSC, hi->input->evbit);
149-
}
150149
}
151150
}
152151

@@ -335,9 +334,8 @@ static int uclogic_raw_event_pen(struct uclogic_drvdata *drvdata,
335334
jiffies + msecs_to_jiffies(100));
336335
}
337336
/* If we report tilt and Y direction is flipped */
338-
if (size >= 12 && pen->tilt_y_flipped) {
337+
if (size >= 12 && pen->tilt_y_flipped)
339338
data[11] = -data[11];
340-
}
341339

342340
return 0;
343341
}
@@ -401,22 +399,21 @@ static int uclogic_raw_event_frame(
401399
/* If need to, and can, transform the touch ring reports */
402400
if (frame->touch_byte > 0 && frame->touch_byte < size) {
403401
__s8 value = data[frame->touch_byte];
402+
404403
if (value != 0) {
405404
if (frame->touch_flip_at != 0) {
406405
value = frame->touch_flip_at - value;
407-
if (value <= 0) {
406+
if (value <= 0)
408407
value = frame->touch_max + value;
409-
}
410408
}
411409
data[frame->touch_byte] = value - 1;
412410
}
413411
}
414412

415413
/* If need to, and can, transform the bitmap dial reports */
416414
if (frame->bitmap_dial_byte > 0 && frame->bitmap_dial_byte < size) {
417-
if (data[frame->bitmap_dial_byte] == 2) {
415+
if (data[frame->bitmap_dial_byte] == 2)
418416
data[frame->bitmap_dial_byte] = -1;
419-
}
420417
}
421418

422419
return 0;
@@ -434,9 +431,8 @@ static int uclogic_raw_event(struct hid_device *hdev,
434431
size_t i;
435432

436433
/* Do not handle anything but input reports */
437-
if (report->type != HID_INPUT_REPORT) {
434+
if (report->type != HID_INPUT_REPORT)
438435
return 0;
439-
}
440436

441437
while (true) {
442438
/* Tweak pen reports, if necessary */

hid-uclogic-params.c

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -345,19 +345,19 @@ static s32 uclogic_params_get_le24(const void *p)
345345
* modified in case of error, or if parameters are not
346346
* found. Cannot be NULL.
347347
* @pfound: Location for a flag which is set to true if the
348-
* parameters were found, and to false if not (e.g.
349-
* device was incompatible). Not modified in case of
350-
* error. Cannot be NULL.
348+
* parameters were found, and to false if not (e.g.
349+
* device was incompatible). Not modified in case of
350+
* error. Cannot be NULL.
351351
* @pparams_ptr: Location for a kmalloc'ed pointer to the retrieved raw
352-
* parameters, which could be used to identify the tablet
353-
* to some extent. Should be freed with kfree after use.
354-
* NULL, if not needed. Not modified in case of error.
355-
* Only set if *pfound is set to true.
352+
* parameters, which could be used to identify the tablet
353+
* to some extent. Should be freed with kfree after use.
354+
* NULL, if not needed. Not modified in case of error.
355+
* Only set if *pfound is set to true.
356356
* @pparams_len: Location for the length of the retrieved raw
357-
* parameters. NULL, if not needed. Not modified in case
358-
* of error. Only set if *pfound is set to true.
357+
* parameters. NULL, if not needed. Not modified in case
358+
* of error. Only set if *pfound is set to true.
359359
* @hdev: The HID device of the tablet interface to initialize
360-
* and get parameters from. Cannot be NULL.
360+
* and get parameters from. Cannot be NULL.
361361
*
362362
* Returns:
363363
* Zero, if successful. A negative errno code on error.
@@ -478,9 +478,9 @@ static int uclogic_params_pen_init_v2(struct uclogic_params_pen *pen,
478478
*pparams_ptr = buf;
479479
buf = NULL;
480480
}
481-
if (pparams_len != NULL) {
481+
if (pparams_len != NULL)
482482
*pparams_len = params_len;
483-
}
483+
484484
finish:
485485
*pfound = found;
486486
rc = 0;
@@ -625,9 +625,9 @@ void uclogic_params_cleanup(struct uclogic_params *params)
625625
size_t i;
626626
kfree(params->desc_ptr);
627627
uclogic_params_pen_cleanup(&params->pen);
628-
for (i = 0; i < ARRAY_SIZE(params->frame_list); i++) {
628+
for (i = 0; i < ARRAY_SIZE(params->frame_list); i++)
629629
uclogic_params_frame_cleanup(&params->frame_list[i]);
630-
}
630+
631631
memset(params, 0, sizeof(*params));
632632
}
633633
}
@@ -785,8 +785,8 @@ static int uclogic_params_init_with_opt_desc(struct uclogic_params *params,
785785
}
786786

787787
/**
788-
* uclogic_params_huion_init() - initialize a Huion tablet interface and
789-
* discover its parameters.
788+
* uclogic_params_huion_init() - initialize a Huion tablet interface and discover
789+
* its parameters.
790790
*
791791
* @params: Parameters to fill in (to be cleaned with
792792
* uclogic_params_cleanup()). Not modified in case of error.
@@ -878,8 +878,7 @@ static int uclogic_params_huion_init(struct uclogic_params *params,
878878
UCLOGIC_RDESC_V2_FRAME_BUTTONS_ID);
879879
if (rc != 0) {
880880
hid_err(hdev,
881-
"failed creating v2 frame button "
882-
"parameters: %d\n",
881+
"failed creating v2 frame button parameters: %d\n",
883882
rc);
884883
goto cleanup;
885884
}
@@ -902,8 +901,7 @@ static int uclogic_params_huion_init(struct uclogic_params *params,
902901
UCLOGIC_RDESC_V2_FRAME_TOUCH_ID);
903902
if (rc != 0) {
904903
hid_err(hdev,
905-
"failed creating v2 frame touch "
906-
"ring parameters: %d\n",
904+
"failed creating v2 frame touch ring parameters: %d\n",
907905
rc);
908906
goto cleanup;
909907
}
@@ -922,8 +920,7 @@ static int uclogic_params_huion_init(struct uclogic_params *params,
922920
UCLOGIC_RDESC_V2_FRAME_TOUCH_ID);
923921
if (rc != 0) {
924922
hid_err(hdev,
925-
"failed creating v2 frame touch "
926-
"strip parameters: %d\n",
923+
"failed creating v2 frame touch strip parameters: %d\n",
927924
rc);
928925
goto cleanup;
929926
}
@@ -947,8 +944,7 @@ static int uclogic_params_huion_init(struct uclogic_params *params,
947944
UCLOGIC_RDESC_V2_FRAME_DIAL_ID);
948945
if (rc != 0) {
949946
hid_err(hdev,
950-
"failed creating v2 frame dial "
951-
"parameters: %d\n",
947+
"failed creating v2 frame dial parameters: %d\n",
952948
rc);
953949
goto cleanup;
954950
}

0 commit comments

Comments
 (0)