Skip to content

Commit 62f8857

Browse files
Tom RixJiri Kosina
authored andcommitted
HID: amd_sfh: change global variables to static
Smatch reports this representative issue amd_sfh_hid_report_desc.h:182:10: warning: symbol 'gyro3_report_descriptor' was not declared. Should it be static? Similar issues for comp3_report_descriptor and als_report_descriptor. Global variables should not be defined in header files. This only works because amd_sfh_hid_report_desc.h in only included by amd_sfh_hid_desc.c so change the storage-class specifiers to static. Signed-off-by: Tom Rix <trix@redhat.com> Acked-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent 5e20645 commit 62f8857

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_report_desc.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ static const u8 accel3_report_descriptor[] = {
179179
0xC0 /* HID end collection */
180180
};
181181

182-
const u8 gyro3_report_descriptor[] = {
182+
static const u8 gyro3_report_descriptor[] = {
183183
0x05, 0x20, /* Usage page */
184184
0x09, 0x76, /* Motion type Gyro3D */
185185
0xA1, 0x00, /* HID Collection (Physical) */
@@ -340,7 +340,7 @@ const u8 gyro3_report_descriptor[] = {
340340
0xC0, /* HID end collection */
341341
};
342342

343-
const u8 comp3_report_descriptor[] = {
343+
static const u8 comp3_report_descriptor[] = {
344344
0x05, 0x20, /* Usage page */
345345
0x09, 0x83, /* Motion type Orientation compass 3D */
346346
0xA1, 0x00, /* HID Collection (Physical) */
@@ -512,7 +512,7 @@ const u8 comp3_report_descriptor[] = {
512512
0xC0 /* HID end collection */
513513
};
514514

515-
const u8 als_report_descriptor[] = {
515+
static const u8 als_report_descriptor[] = {
516516
0x05, 0x20, /* HID usage page sensor */
517517
0x09, 0x41, /* HID usage sensor type Ambientlight */
518518
0xA1, 0x00, /* HID Collection (Physical) */

0 commit comments

Comments
 (0)