Skip to content

Commit 0b7dd38

Browse files
XenuIsWatchingJiri Kosina
authored andcommitted
HID: nintendo: fix initializer element is not constant error
With gcc-7 builds, an error happens with the controller button values being defined as const. Change to a define. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Ryan McClelland <[email protected]> Reviewed-by: Daniel J. Ogorchock <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent df83a0d commit 0b7dd38

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

drivers/hid/hid-nintendo.c

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -325,28 +325,28 @@ struct joycon_imu_cal {
325325
* All the controller's button values are stored in a u32.
326326
* They can be accessed with bitwise ANDs.
327327
*/
328-
static const u32 JC_BTN_Y = BIT(0);
329-
static const u32 JC_BTN_X = BIT(1);
330-
static const u32 JC_BTN_B = BIT(2);
331-
static const u32 JC_BTN_A = BIT(3);
332-
static const u32 JC_BTN_SR_R = BIT(4);
333-
static const u32 JC_BTN_SL_R = BIT(5);
334-
static const u32 JC_BTN_R = BIT(6);
335-
static const u32 JC_BTN_ZR = BIT(7);
336-
static const u32 JC_BTN_MINUS = BIT(8);
337-
static const u32 JC_BTN_PLUS = BIT(9);
338-
static const u32 JC_BTN_RSTICK = BIT(10);
339-
static const u32 JC_BTN_LSTICK = BIT(11);
340-
static const u32 JC_BTN_HOME = BIT(12);
341-
static const u32 JC_BTN_CAP = BIT(13); /* capture button */
342-
static const u32 JC_BTN_DOWN = BIT(16);
343-
static const u32 JC_BTN_UP = BIT(17);
344-
static const u32 JC_BTN_RIGHT = BIT(18);
345-
static const u32 JC_BTN_LEFT = BIT(19);
346-
static const u32 JC_BTN_SR_L = BIT(20);
347-
static const u32 JC_BTN_SL_L = BIT(21);
348-
static const u32 JC_BTN_L = BIT(22);
349-
static const u32 JC_BTN_ZL = BIT(23);
328+
#define JC_BTN_Y BIT(0)
329+
#define JC_BTN_X BIT(1)
330+
#define JC_BTN_B BIT(2)
331+
#define JC_BTN_A BIT(3)
332+
#define JC_BTN_SR_R BIT(4)
333+
#define JC_BTN_SL_R BIT(5)
334+
#define JC_BTN_R BIT(6)
335+
#define JC_BTN_ZR BIT(7)
336+
#define JC_BTN_MINUS BIT(8)
337+
#define JC_BTN_PLUS BIT(9)
338+
#define JC_BTN_RSTICK BIT(10)
339+
#define JC_BTN_LSTICK BIT(11)
340+
#define JC_BTN_HOME BIT(12)
341+
#define JC_BTN_CAP BIT(13) /* capture button */
342+
#define JC_BTN_DOWN BIT(16)
343+
#define JC_BTN_UP BIT(17)
344+
#define JC_BTN_RIGHT BIT(18)
345+
#define JC_BTN_LEFT BIT(19)
346+
#define JC_BTN_SR_L BIT(20)
347+
#define JC_BTN_SL_L BIT(21)
348+
#define JC_BTN_L BIT(22)
349+
#define JC_BTN_ZL BIT(23)
350350

351351
enum joycon_msg_type {
352352
JOYCON_MSG_TYPE_NONE,

0 commit comments

Comments
 (0)