* [PATCH] HID: nintendo: fix initializer element is not constant error [not found] <202312141227.C2h1IzfI-lkp@intel.com> @ 2023-12-14 17:25 ` Ryan McClelland 2023-12-18 7:33 ` Daniel Ogorchock 2023-12-18 8:55 ` Jiri Kosina 0 siblings, 2 replies; 3+ messages in thread From: Ryan McClelland @ 2023-12-14 17:25 UTC (permalink / raw) To: lkp, linux-input Cc: jkosina, linux-mm, oe-kbuild-all, djogorchock, benjamin.tissoires, jikos, Ryan McClelland 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 <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202312141227.C2h1IzfI-lkp@intel.com/ Signed-off-by: Ryan McClelland <rymcclel@gmail.com> --- drivers/hid/hid-nintendo.c | 44 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c index 47af111ef3a2..2987083785f9 100644 --- a/drivers/hid/hid-nintendo.c +++ b/drivers/hid/hid-nintendo.c @@ -336,28 +336,28 @@ struct joycon_imu_cal { * All the controller's button values are stored in a u32. * They can be accessed with bitwise ANDs. */ -static const u32 JC_BTN_Y = BIT(0); -static const u32 JC_BTN_X = BIT(1); -static const u32 JC_BTN_B = BIT(2); -static const u32 JC_BTN_A = BIT(3); -static const u32 JC_BTN_SR_R = BIT(4); -static const u32 JC_BTN_SL_R = BIT(5); -static const u32 JC_BTN_R = BIT(6); -static const u32 JC_BTN_ZR = BIT(7); -static const u32 JC_BTN_MINUS = BIT(8); -static const u32 JC_BTN_PLUS = BIT(9); -static const u32 JC_BTN_RSTICK = BIT(10); -static const u32 JC_BTN_LSTICK = BIT(11); -static const u32 JC_BTN_HOME = BIT(12); -static const u32 JC_BTN_CAP = BIT(13); /* capture button */ -static const u32 JC_BTN_DOWN = BIT(16); -static const u32 JC_BTN_UP = BIT(17); -static const u32 JC_BTN_RIGHT = BIT(18); -static const u32 JC_BTN_LEFT = BIT(19); -static const u32 JC_BTN_SR_L = BIT(20); -static const u32 JC_BTN_SL_L = BIT(21); -static const u32 JC_BTN_L = BIT(22); -static const u32 JC_BTN_ZL = BIT(23); +#define JC_BTN_Y BIT(0) +#define JC_BTN_X BIT(1) +#define JC_BTN_B BIT(2) +#define JC_BTN_A BIT(3) +#define JC_BTN_SR_R BIT(4) +#define JC_BTN_SL_R BIT(5) +#define JC_BTN_R BIT(6) +#define JC_BTN_ZR BIT(7) +#define JC_BTN_MINUS BIT(8) +#define JC_BTN_PLUS BIT(9) +#define JC_BTN_RSTICK BIT(10) +#define JC_BTN_LSTICK BIT(11) +#define JC_BTN_HOME BIT(12) +#define JC_BTN_CAP BIT(13) /* capture button */ +#define JC_BTN_DOWN BIT(16) +#define JC_BTN_UP BIT(17) +#define JC_BTN_RIGHT BIT(18) +#define JC_BTN_LEFT BIT(19) +#define JC_BTN_SR_L BIT(20) +#define JC_BTN_SL_L BIT(21) +#define JC_BTN_L BIT(22) +#define JC_BTN_ZL BIT(23) struct joycon_ctlr_button_mapping { u32 code; -- 2.25.1 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] HID: nintendo: fix initializer element is not constant error 2023-12-14 17:25 ` [PATCH] HID: nintendo: fix initializer element is not constant error Ryan McClelland @ 2023-12-18 7:33 ` Daniel Ogorchock 2023-12-18 8:55 ` Jiri Kosina 1 sibling, 0 replies; 3+ messages in thread From: Daniel Ogorchock @ 2023-12-18 7:33 UTC (permalink / raw) To: Ryan McClelland Cc: lkp, linux-input, jkosina, linux-mm, oe-kbuild-all, benjamin.tissoires, jikos Hi Ryan, On Thu, Dec 14, 2023 at 12:26 PM Ryan McClelland <rymcclel@gmail.com> wrote: > > 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 <lkp@intel.com> > Closes: https://lore.kernel.org/oe-kbuild-all/202312141227.C2h1IzfI-lkp@intel.com/ > > Signed-off-by: Ryan McClelland <rymcclel@gmail.com> > --- > drivers/hid/hid-nintendo.c | 44 +++++++++++++++++++------------------- > 1 file changed, 22 insertions(+), 22 deletions(-) > > diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c > index 47af111ef3a2..2987083785f9 100644 > --- a/drivers/hid/hid-nintendo.c > +++ b/drivers/hid/hid-nintendo.c > @@ -336,28 +336,28 @@ struct joycon_imu_cal { > * All the controller's button values are stored in a u32. > * They can be accessed with bitwise ANDs. > */ > -static const u32 JC_BTN_Y = BIT(0); > -static const u32 JC_BTN_X = BIT(1); > -static const u32 JC_BTN_B = BIT(2); > -static const u32 JC_BTN_A = BIT(3); > -static const u32 JC_BTN_SR_R = BIT(4); > -static const u32 JC_BTN_SL_R = BIT(5); > -static const u32 JC_BTN_R = BIT(6); > -static const u32 JC_BTN_ZR = BIT(7); > -static const u32 JC_BTN_MINUS = BIT(8); > -static const u32 JC_BTN_PLUS = BIT(9); > -static const u32 JC_BTN_RSTICK = BIT(10); > -static const u32 JC_BTN_LSTICK = BIT(11); > -static const u32 JC_BTN_HOME = BIT(12); > -static const u32 JC_BTN_CAP = BIT(13); /* capture button */ > -static const u32 JC_BTN_DOWN = BIT(16); > -static const u32 JC_BTN_UP = BIT(17); > -static const u32 JC_BTN_RIGHT = BIT(18); > -static const u32 JC_BTN_LEFT = BIT(19); > -static const u32 JC_BTN_SR_L = BIT(20); > -static const u32 JC_BTN_SL_L = BIT(21); > -static const u32 JC_BTN_L = BIT(22); > -static const u32 JC_BTN_ZL = BIT(23); > +#define JC_BTN_Y BIT(0) > +#define JC_BTN_X BIT(1) > +#define JC_BTN_B BIT(2) > +#define JC_BTN_A BIT(3) > +#define JC_BTN_SR_R BIT(4) > +#define JC_BTN_SL_R BIT(5) > +#define JC_BTN_R BIT(6) > +#define JC_BTN_ZR BIT(7) > +#define JC_BTN_MINUS BIT(8) > +#define JC_BTN_PLUS BIT(9) > +#define JC_BTN_RSTICK BIT(10) > +#define JC_BTN_LSTICK BIT(11) > +#define JC_BTN_HOME BIT(12) > +#define JC_BTN_CAP BIT(13) /* capture button */ > +#define JC_BTN_DOWN BIT(16) > +#define JC_BTN_UP BIT(17) > +#define JC_BTN_RIGHT BIT(18) > +#define JC_BTN_LEFT BIT(19) > +#define JC_BTN_SR_L BIT(20) > +#define JC_BTN_SL_L BIT(21) > +#define JC_BTN_L BIT(22) > +#define JC_BTN_ZL BIT(23) > > struct joycon_ctlr_button_mapping { > u32 code; > -- > 2.25.1 > Thanks for the quick fix. Reviewed-by: Daniel J. Ogorchock <djogorchock@gmail.com> -Daniel ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] HID: nintendo: fix initializer element is not constant error 2023-12-14 17:25 ` [PATCH] HID: nintendo: fix initializer element is not constant error Ryan McClelland 2023-12-18 7:33 ` Daniel Ogorchock @ 2023-12-18 8:55 ` Jiri Kosina 1 sibling, 0 replies; 3+ messages in thread From: Jiri Kosina @ 2023-12-18 8:55 UTC (permalink / raw) To: Ryan McClelland Cc: lkp, linux-input, linux-mm, oe-kbuild-all, djogorchock, benjamin.tissoires On Thu, 14 Dec 2023, Ryan McClelland wrote: > 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 <lkp@intel.com> > Closes: https://lore.kernel.org/oe-kbuild-all/202312141227.C2h1IzfI-lkp@intel.com/ > > Signed-off-by: Ryan McClelland <rymcclel@gmail.com> Applied, thanks. -- Jiri Kosina SUSE Labs ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-12-18 8:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <202312141227.C2h1IzfI-lkp@intel.com>
2023-12-14 17:25 ` [PATCH] HID: nintendo: fix initializer element is not constant error Ryan McClelland
2023-12-18 7:33 ` Daniel Ogorchock
2023-12-18 8:55 ` Jiri Kosina
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox