HID: debug: Remove duplicates from 'keys'
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 16 Oct 2024 13:32:40 +0000 (16:32 +0300)
committerJiri Kosina <jkosina@suse.com>
Fri, 18 Oct 2024 10:24:52 +0000 (12:24 +0200)
commit7b2daa648eb75ec75a6ebf5fce5629b758ea06df
tree0e3319cfc251d062049805cad96faf650d208a56
parentb2b8a75e1d88c551a0b30d44d0be552210219eea
HID: debug: Remove duplicates from 'keys'

Duplicates in 'keys prevents kernel builds with clang, `make W=1` and
CONFIG_WERROR=y, for example:

drivers/hid/hid-debug.c:3443:18: error: initializer overrides prior initialization of this subobject [-Werror,-Winitializer-overrides]
 3443 |         [KEY_HANGEUL] = "HanGeul",              [KEY_HANGUP_PHONE] = "HangUpPhone",
      |                         ^~~~~~~~~
drivers/hid/hid-debug.c:3217:18: note: previous initialization is here
 3217 |         [KEY_HANGUEL] = "Hangeul",              [KEY_HANJA] = "Hanja",
      |                         ^~~~~~~~~

Fix this by removing them.

The logic of removal is that, remove...
1) if there is a constant that uses another defined constant, OR
2) the one that appears later in the list.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/hid-debug.c