Skip to content

Commit 1adf904

Browse files
pavelmachekJiri Kosina
authored andcommitted
HID: sony: underscores are unnecessary for u8, u16, s32
Double-underscore prefixed types are unnecessary in pure kernel code, replace them with the non prefixed equivalents. Signed-off-by: Pavel Machek <[email protected]> Signed-off-by: Antonio Ospite <[email protected]> Acked-by: Frank Praznik <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent ef916ef commit 1adf904

File tree

1 file changed

+57
-57
lines changed

1 file changed

+57
-57
lines changed

drivers/hid/hid-sony.c

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
* axis values. Additionally, the controller only has 20 actual, physical axes
7676
* so there are several unused axes in between the used ones.
7777
*/
78-
static __u8 sixaxis_rdesc[] = {
78+
static u8 sixaxis_rdesc[] = {
7979
0x05, 0x01, /* Usage Page (Desktop), */
8080
0x09, 0x04, /* Usage (Joystick), */
8181
0xA1, 0x01, /* Collection (Application), */
@@ -153,7 +153,7 @@ static __u8 sixaxis_rdesc[] = {
153153
};
154154

155155
/* PS/3 Motion controller */
156-
static __u8 motion_rdesc[] = {
156+
static u8 motion_rdesc[] = {
157157
0x05, 0x01, /* Usage Page (Desktop), */
158158
0x09, 0x04, /* Usage (Joystick), */
159159
0xA1, 0x01, /* Collection (Application), */
@@ -250,7 +250,7 @@ static __u8 motion_rdesc[] = {
250250
};
251251

252252
/* PS/3 Navigation controller */
253-
static __u8 navigation_rdesc[] = {
253+
static u8 navigation_rdesc[] = {
254254
0x05, 0x01, /* Usage Page (Desktop), */
255255
0x09, 0x04, /* Usage (Joystik), */
256256
0xA1, 0x01, /* Collection (Application), */
@@ -810,7 +810,7 @@ static u8 dualshock4_bt_rdesc[] = {
810810
0xC0 /* End Collection */
811811
};
812812

813-
static __u8 ps3remote_rdesc[] = {
813+
static u8 ps3remote_rdesc[] = {
814814
0x05, 0x01, /* GUsagePage Generic Desktop */
815815
0x09, 0x05, /* LUsage 0x05 [Game Pad] */
816816
0xA1, 0x01, /* MCollection Application (mouse, keyboard) */
@@ -980,33 +980,33 @@ static enum power_supply_property sony_battery_props[] = {
980980
};
981981

982982
struct sixaxis_led {
983-
__u8 time_enabled; /* the total time the led is active (0xff means forever) */
984-
__u8 duty_length; /* how long a cycle is in deciseconds (0 means "really fast") */
985-
__u8 enabled;
986-
__u8 duty_off; /* % of duty_length the led is off (0xff means 100%) */
987-
__u8 duty_on; /* % of duty_length the led is on (0xff mean 100%) */
983+
u8 time_enabled; /* the total time the led is active (0xff means forever) */
984+
u8 duty_length; /* how long a cycle is in deciseconds (0 means "really fast") */
985+
u8 enabled;
986+
u8 duty_off; /* % of duty_length the led is off (0xff means 100%) */
987+
u8 duty_on; /* % of duty_length the led is on (0xff mean 100%) */
988988
} __packed;
989989

990990
struct sixaxis_rumble {
991-
__u8 padding;
992-
__u8 right_duration; /* Right motor duration (0xff means forever) */
993-
__u8 right_motor_on; /* Right (small) motor on/off, only supports values of 0 or 1 (off/on) */
994-
__u8 left_duration; /* Left motor duration (0xff means forever) */
995-
__u8 left_motor_force; /* left (large) motor, supports force values from 0 to 255 */
991+
u8 padding;
992+
u8 right_duration; /* Right motor duration (0xff means forever) */
993+
u8 right_motor_on; /* Right (small) motor on/off, only supports values of 0 or 1 (off/on) */
994+
u8 left_duration; /* Left motor duration (0xff means forever) */
995+
u8 left_motor_force; /* left (large) motor, supports force values from 0 to 255 */
996996
} __packed;
997997

998998
struct sixaxis_output_report {
999-
__u8 report_id;
999+
u8 report_id;
10001000
struct sixaxis_rumble rumble;
1001-
__u8 padding[4];
1002-
__u8 leds_bitmap; /* bitmap of enabled LEDs: LED_1 = 0x02, LED_2 = 0x04, ... */
1001+
u8 padding[4];
1002+
u8 leds_bitmap; /* bitmap of enabled LEDs: LED_1 = 0x02, LED_2 = 0x04, ... */
10031003
struct sixaxis_led led[4]; /* LEDx at (4 - x) */
10041004
struct sixaxis_led _reserved; /* LED5, not actually soldered */
10051005
} __packed;
10061006

10071007
union sixaxis_output_report_01 {
10081008
struct sixaxis_output_report data;
1009-
__u8 buf[36];
1009+
u8 buf[36];
10101010
};
10111011

10121012
struct motion_output_report_02 {
@@ -1039,26 +1039,26 @@ struct sony_sc {
10391039
struct power_supply *battery;
10401040
struct power_supply_desc battery_desc;
10411041
int device_id;
1042-
__u8 *output_report_dmabuf;
1042+
u8 *output_report_dmabuf;
10431043

10441044
#ifdef CONFIG_SONY_FF
1045-
__u8 left;
1046-
__u8 right;
1045+
u8 left;
1046+
u8 right;
10471047
#endif
10481048

1049-
__u8 mac_address[6];
1050-
__u8 worker_initialized;
1051-
__u8 cable_state;
1052-
__u8 battery_charging;
1053-
__u8 battery_capacity;
1054-
__u8 led_state[MAX_LEDS];
1055-
__u8 resume_led_state[MAX_LEDS];
1056-
__u8 led_delay_on[MAX_LEDS];
1057-
__u8 led_delay_off[MAX_LEDS];
1058-
__u8 led_count;
1049+
u8 mac_address[6];
1050+
u8 worker_initialized;
1051+
u8 cable_state;
1052+
u8 battery_charging;
1053+
u8 battery_capacity;
1054+
u8 led_state[MAX_LEDS];
1055+
u8 resume_led_state[MAX_LEDS];
1056+
u8 led_delay_on[MAX_LEDS];
1057+
u8 led_delay_off[MAX_LEDS];
1058+
u8 led_count;
10591059
};
10601060

1061-
static __u8 *sixaxis_fixup(struct hid_device *hdev, __u8 *rdesc,
1061+
static u8 *sixaxis_fixup(struct hid_device *hdev, u8 *rdesc,
10621062
unsigned int *rsize)
10631063
{
10641064
*rsize = sizeof(sixaxis_rdesc);
@@ -1079,7 +1079,7 @@ static u8 *navigation_fixup(struct hid_device *hdev, u8 *rdesc,
10791079
return navigation_rdesc;
10801080
}
10811081

1082-
static __u8 *ps3remote_fixup(struct hid_device *hdev, __u8 *rdesc,
1082+
static u8 *ps3remote_fixup(struct hid_device *hdev, u8 *rdesc,
10831083
unsigned int *rsize)
10841084
{
10851085
*rsize = sizeof(ps3remote_rdesc);
@@ -1120,7 +1120,7 @@ static int ps3remote_mapping(struct hid_device *hdev, struct hid_input *hi,
11201120
return 1;
11211121
}
11221122

1123-
static __u8 *sony_report_fixup(struct hid_device *hdev, __u8 *rdesc,
1123+
static u8 *sony_report_fixup(struct hid_device *hdev, u8 *rdesc,
11241124
unsigned int *rsize)
11251125
{
11261126
struct sony_sc *sc = hid_get_drvdata(hdev);
@@ -1174,12 +1174,12 @@ static __u8 *sony_report_fixup(struct hid_device *hdev, __u8 *rdesc,
11741174
return rdesc;
11751175
}
11761176

1177-
static void sixaxis_parse_report(struct sony_sc *sc, __u8 *rd, int size)
1177+
static void sixaxis_parse_report(struct sony_sc *sc, u8 *rd, int size)
11781178
{
1179-
static const __u8 sixaxis_battery_capacity[] = { 0, 1, 25, 50, 75, 100 };
1179+
static const u8 sixaxis_battery_capacity[] = { 0, 1, 25, 50, 75, 100 };
11801180
unsigned long flags;
11811181
int offset;
1182-
__u8 cable_state, battery_capacity, battery_charging;
1182+
u8 cable_state, battery_capacity, battery_charging;
11831183

11841184
/*
11851185
* The sixaxis is charging if the battery value is 0xee
@@ -1194,7 +1194,7 @@ static void sixaxis_parse_report(struct sony_sc *sc, __u8 *rd, int size)
11941194
battery_charging = !(rd[offset] & 0x01);
11951195
cable_state = 1;
11961196
} else {
1197-
__u8 index = rd[offset] <= 5 ? rd[offset] : 5;
1197+
u8 index = rd[offset] <= 5 ? rd[offset] : 5;
11981198
battery_capacity = sixaxis_battery_capacity[index];
11991199
battery_charging = 0;
12001200
cable_state = 0;
@@ -1207,14 +1207,14 @@ static void sixaxis_parse_report(struct sony_sc *sc, __u8 *rd, int size)
12071207
spin_unlock_irqrestore(&sc->lock, flags);
12081208
}
12091209

1210-
static void dualshock4_parse_report(struct sony_sc *sc, __u8 *rd, int size)
1210+
static void dualshock4_parse_report(struct sony_sc *sc, u8 *rd, int size)
12111211
{
12121212
struct hid_input *hidinput = list_entry(sc->hdev->inputs.next,
12131213
struct hid_input, list);
12141214
struct input_dev *input_dev = hidinput->input;
12151215
unsigned long flags;
12161216
int n, offset;
1217-
__u8 cable_state, battery_capacity, battery_charging;
1217+
u8 cable_state, battery_capacity, battery_charging;
12181218

12191219
/*
12201220
* Battery and touchpad data starts at byte 30 in the USB report and
@@ -1264,7 +1264,7 @@ static void dualshock4_parse_report(struct sony_sc *sc, __u8 *rd, int size)
12641264
* follows the data for the first.
12651265
*/
12661266
for (n = 0; n < 2; n++) {
1267-
__u16 x, y;
1267+
u16 x, y;
12681268

12691269
x = rd[offset+1] | ((rd[offset+2] & 0xF) << 8);
12701270
y = ((rd[offset+2] & 0xF0) >> 4) | (rd[offset+3] << 4);
@@ -1280,7 +1280,7 @@ static void dualshock4_parse_report(struct sony_sc *sc, __u8 *rd, int size)
12801280
}
12811281

12821282
static int sony_raw_event(struct hid_device *hdev, struct hid_report *report,
1283-
__u8 *rd, int size)
1283+
u8 *rd, int size)
12841284
{
12851285
struct sony_sc *sc = hid_get_drvdata(hdev);
12861286

@@ -1404,7 +1404,7 @@ static int sixaxis_set_operational_usb(struct hid_device *hdev)
14041404
{
14051405
const int buf_size =
14061406
max(SIXAXIS_REPORT_0xF2_SIZE, SIXAXIS_REPORT_0xF5_SIZE);
1407-
__u8 *buf;
1407+
u8 *buf;
14081408
int ret;
14091409

14101410
buf = kmalloc(buf_size, GFP_KERNEL);
@@ -1443,8 +1443,8 @@ static int sixaxis_set_operational_usb(struct hid_device *hdev)
14431443

14441444
static int sixaxis_set_operational_bt(struct hid_device *hdev)
14451445
{
1446-
static const __u8 report[] = { 0xf4, 0x42, 0x03, 0x00, 0x00 };
1447-
__u8 *buf;
1446+
static const u8 report[] = { 0xf4, 0x42, 0x03, 0x00, 0x00 };
1447+
u8 *buf;
14481448
int ret;
14491449

14501450
buf = kmemdup(report, sizeof(report), GFP_KERNEL);
@@ -1465,7 +1465,7 @@ static int sixaxis_set_operational_bt(struct hid_device *hdev)
14651465
*/
14661466
static int dualshock4_set_operational_bt(struct hid_device *hdev)
14671467
{
1468-
__u8 *buf;
1468+
u8 *buf;
14691469
int ret;
14701470

14711471
buf = kmalloc(DS4_REPORT_0x02_SIZE, GFP_KERNEL);
@@ -1482,7 +1482,7 @@ static int dualshock4_set_operational_bt(struct hid_device *hdev)
14821482

14831483
static void sixaxis_set_leds_from_id(struct sony_sc *sc)
14841484
{
1485-
static const __u8 sixaxis_leds[10][4] = {
1485+
static const u8 sixaxis_leds[10][4] = {
14861486
{ 0x01, 0x00, 0x00, 0x00 },
14871487
{ 0x00, 0x01, 0x00, 0x00 },
14881488
{ 0x00, 0x00, 0x01, 0x00 },
@@ -1509,7 +1509,7 @@ static void sixaxis_set_leds_from_id(struct sony_sc *sc)
15091509
static void dualshock4_set_leds_from_id(struct sony_sc *sc)
15101510
{
15111511
/* The first 4 color/index entries match what the PS4 assigns */
1512-
static const __u8 color_code[7][3] = {
1512+
static const u8 color_code[7][3] = {
15131513
/* Blue */ { 0x00, 0x00, 0x01 },
15141514
/* Red */ { 0x01, 0x00, 0x00 },
15151515
/* Green */ { 0x00, 0x01, 0x00 },
@@ -1537,7 +1537,7 @@ static void buzz_set_leds(struct sony_sc *sc)
15371537
&hdev->report_enum[HID_OUTPUT_REPORT].report_list;
15381538
struct hid_report *report = list_entry(report_list->next,
15391539
struct hid_report, list);
1540-
__s32 *value = report->field[0]->value;
1540+
s32 *value = report->field[0]->value;
15411541

15421542
BUILD_BUG_ON(MAX_LEDS < 4);
15431543

@@ -1631,7 +1631,7 @@ static int sony_led_blink_set(struct led_classdev *led, unsigned long *delay_on,
16311631
struct hid_device *hdev = to_hid_device(dev);
16321632
struct sony_sc *drv_data = hid_get_drvdata(hdev);
16331633
int n;
1634-
__u8 new_on, new_off;
1634+
u8 new_on, new_off;
16351635

16361636
if (!drv_data) {
16371637
hid_err(hdev, "No device data\n");
@@ -1702,8 +1702,8 @@ static int sony_leds_init(struct sony_sc *sc)
17021702
const char *name_fmt;
17031703
static const char * const ds4_name_str[] = { "red", "green", "blue",
17041704
"global" };
1705-
__u8 max_brightness[MAX_LEDS] = { [0 ... (MAX_LEDS - 1)] = 1 };
1706-
__u8 use_hw_blink[MAX_LEDS] = { 0 };
1705+
u8 max_brightness[MAX_LEDS] = { [0 ... (MAX_LEDS - 1)] = 1 };
1706+
u8 use_hw_blink[MAX_LEDS] = { 0 };
17071707

17081708
BUG_ON(!(sc->quirks & SONY_LED_SUPPORT));
17091709

@@ -1731,7 +1731,7 @@ static int sony_leds_init(struct sony_sc *sc)
17311731
name_len = 0;
17321732
name_fmt = "%s:%s";
17331733
} else if (sc->quirks & NAVIGATION_CONTROLLER) {
1734-
static const __u8 navigation_leds[4] = {0x01, 0x00, 0x00, 0x00};
1734+
static const u8 navigation_leds[4] = {0x01, 0x00, 0x00, 0x00};
17351735

17361736
memcpy(sc->led_state, navigation_leds, sizeof(navigation_leds));
17371737
sc->led_count = 1;
@@ -1854,15 +1854,15 @@ static void sixaxis_send_output_report(struct sony_sc *sc)
18541854
}
18551855
}
18561856

1857-
hid_hw_raw_request(sc->hdev, report->report_id, (__u8 *)report,
1857+
hid_hw_raw_request(sc->hdev, report->report_id, (u8 *)report,
18581858
sizeof(struct sixaxis_output_report),
18591859
HID_OUTPUT_REPORT, HID_REQ_SET_REPORT);
18601860
}
18611861

18621862
static void dualshock4_send_output_report(struct sony_sc *sc)
18631863
{
18641864
struct hid_device *hdev = sc->hdev;
1865-
__u8 *buf = sc->output_report_dmabuf;
1865+
u8 *buf = sc->output_report_dmabuf;
18661866
int offset;
18671867

18681868
if (sc->quirks & DUALSHOCK4_CONTROLLER_USB) {
@@ -1922,7 +1922,7 @@ static void motion_send_output_report(struct sony_sc *sc)
19221922
report->rumble = max(sc->right, sc->left);
19231923
#endif
19241924

1925-
hid_hw_output_report(hdev, (__u8 *)report, MOTION_REPORT_0x02_SIZE);
1925+
hid_hw_output_report(hdev, (u8 *)report, MOTION_REPORT_0x02_SIZE);
19261926
}
19271927

19281928
static inline void sony_send_output_report(struct sony_sc *sc)
@@ -2155,7 +2155,7 @@ static int sony_get_bt_devaddr(struct sony_sc *sc)
21552155

21562156
static int sony_check_add(struct sony_sc *sc)
21572157
{
2158-
__u8 *buf = NULL;
2158+
u8 *buf = NULL;
21592159
int n, ret;
21602160

21612161
if ((sc->quirks & DUALSHOCK4_CONTROLLER_BT) ||

0 commit comments

Comments
 (0)