[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202110221813.xxu1rf2C-lkp@intel.com>
Date: Fri, 22 Oct 2021 18:25:31 +0800
From: kernel test robot <lkp@...el.com>
To: Emmanuel Gil Peyrot <linkmauve@...kmauve.fr>,
Jiri Kosina <jikos@...nel.org>
Cc: kbuild-all@...ts.01.org,
Emmanuel Gil Peyrot <linkmauve@...kmauve.fr>,
linux-input@...r.kernel.org, Ash Logan <ash@...quark.com>,
Jonathan Neuschäfer <j.ne@...teo.net>,
Barnabás Pőcze <pobrn@...tonmail.com>,
Benjamin Tissoires <benjamin.tissoires@...hat.com>,
linux-kernel@...r.kernel.org,
"Daniel J . Ogorchock" <djogorchock@...il.com>
Subject: Re: [PATCH v4 1/5] HID: nintendo: split switch support into its own
file
Hi Emmanuel,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on hid/for-next]
[cannot apply to jikos-trivial/for-next v5.15-rc6 next-20211021]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Emmanuel-Gil-Peyrot/HID-nintendo-split-switch-support-into-its-own-file/20211019-200531
base: https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git for-next
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/ef6cb9d1fa01a825280bca49c84b644b8d08bfa6
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Emmanuel-Gil-Peyrot/HID-nintendo-split-switch-support-into-its-own-file/20211019-200531
git checkout ef6cb9d1fa01a825280bca49c84b644b8d08bfa6
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
All errors (new ones prefixed by >>):
drivers/hid/hid-nintendo-switch.c:406:2: error: 'LED_FUNCTION_PLAYER1' undeclared here (not in a function); did you mean 'LED_FUNCTION_ALARM'?
406 | LED_FUNCTION_PLAYER1,
| ^~~~~~~~~~~~~~~~~~~~
| LED_FUNCTION_ALARM
drivers/hid/hid-nintendo-switch.c:407:2: error: 'LED_FUNCTION_PLAYER2' undeclared here (not in a function); did you mean 'LED_FUNCTION_ALARM'?
407 | LED_FUNCTION_PLAYER2,
| ^~~~~~~~~~~~~~~~~~~~
| LED_FUNCTION_ALARM
drivers/hid/hid-nintendo-switch.c:408:2: error: 'LED_FUNCTION_PLAYER3' undeclared here (not in a function); did you mean 'LED_FUNCTION_ALARM'?
408 | LED_FUNCTION_PLAYER3,
| ^~~~~~~~~~~~~~~~~~~~
| LED_FUNCTION_ALARM
drivers/hid/hid-nintendo-switch.c:409:2: error: 'LED_FUNCTION_PLAYER4' undeclared here (not in a function); did you mean 'LED_FUNCTION_ALARM'?
409 | LED_FUNCTION_PLAYER4,
| ^~~~~~~~~~~~~~~~~~~~
| LED_FUNCTION_ALARM
drivers/hid/hid-nintendo-switch.c: In function 'joycon_leds_create':
drivers/hid/hid-nintendo-switch.c:1881:11: error: 'LED_FUNCTION_PLAYER5' undeclared (first use in this function); did you mean 'LED_FUNCTION_ALARM'?
1881 | LED_FUNCTION_PLAYER5);
| ^~~~~~~~~~~~~~~~~~~~
| LED_FUNCTION_ALARM
drivers/hid/hid-nintendo-switch.c:1881:11: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/hid/hid-nintendo-switch.c:1878:50: error: format '%s' expects argument of type 'char *', but argument 6 has type 'const char * const*' [-Werror=format=]
1878 | name = devm_kasprintf(dev, GFP_KERNEL, "%s:%s:%s",
| ~^
| |
| char *
......
1881 | LED_FUNCTION_PLAYER5);
| ~~~~~~~~~~~~~~~~~~~~
| |
| const char * const*
At top level:
drivers/hid/hid-nintendo-switch.c:99:17: error: 'JC_USB_SEND_UART' defined but not used [-Werror=unused-const-variable=]
99 | static const u8 JC_USB_SEND_UART = 0x92;
| ^~~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:98:17: error: 'JC_USB_PRE_HANDSHAKE' defined but not used [-Werror=unused-const-variable=]
98 | static const u8 JC_USB_PRE_HANDSHAKE = 0x91;
| ^~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:97:17: error: 'JC_USB_RESET' defined but not used [-Werror=unused-const-variable=]
97 | static const u8 JC_USB_RESET = 0x06;
| ^~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:96:17: error: 'JC_USB_CMD_EN_TIMEOUT' defined but not used [-Werror=unused-const-variable=]
96 | static const u8 JC_USB_CMD_EN_TIMEOUT = 0x05;
| ^~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:92:17: error: 'JC_USB_CMD_CONN_STATUS' defined but not used [-Werror=unused-const-variable=]
92 | static const u8 JC_USB_CMD_CONN_STATUS = 0x01;
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:89:17: error: 'JC_FEATURE_LAUNCH' defined but not used [-Werror=unused-const-variable=]
89 | static const u8 JC_FEATURE_LAUNCH = 0x75;
| ^~~~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:88:17: error: 'JC_FEATURE_MEM_WRITE' defined but not used [-Werror=unused-const-variable=]
88 | static const u8 JC_FEATURE_MEM_WRITE = 0x74;
| ^~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:87:17: error: 'JC_FEATURE_ERASE_MEM_SECTOR' defined but not used [-Werror=unused-const-variable=]
87 | static const u8 JC_FEATURE_ERASE_MEM_SECTOR = 0x73;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:86:17: error: 'JC_FEATURE_MEM_READ' defined but not used [-Werror=unused-const-variable=]
86 | static const u8 JC_FEATURE_MEM_READ = 0x72;
| ^~~~~~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:85:17: error: 'JC_FEATURE_SETUP_MEM_READ' defined but not used [-Werror=unused-const-variable=]
85 | static const u8 JC_FEATURE_SETUP_MEM_READ = 0x71;
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:84:17: error: 'JC_FEATURE_OTA_FW_UPGRADE' defined but not used [-Werror=unused-const-variable=]
84 | static const u8 JC_FEATURE_OTA_FW_UPGRADE = 0x70;
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:83:17: error: 'JC_FEATURE_LAST_SUBCMD' defined but not used [-Werror=unused-const-variable=]
83 | static const u8 JC_FEATURE_LAST_SUBCMD = 0x02;
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:76:17: error: 'JC_INPUT_BUTTON_EVENT' defined but not used [-Werror=unused-const-variable=]
76 | static const u8 JC_INPUT_BUTTON_EVENT = 0x3F;
| ^~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:73:17: error: 'JC_SUBCMD_GET_REGULATED_VOLTAGE' defined but not used [-Werror=unused-const-variable=]
73 | static const u8 JC_SUBCMD_GET_REGULATED_VOLTAGE = 0x50;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:71:17: error: 'JC_SUBCMD_READ_IMU_REG' defined but not used [-Werror=unused-const-variable=]
71 | static const u8 JC_SUBCMD_READ_IMU_REG = 0x43;
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:70:17: error: 'JC_SUBCMD_WRITE_IMU_REG' defined but not used [-Werror=unused-const-variable=]
70 | static const u8 JC_SUBCMD_WRITE_IMU_REG = 0x42;
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:69:17: error: 'JC_SUBCMD_SET_IMU_SENSITIVITY' defined but not used [-Werror=unused-const-variable=]
69 | static const u8 JC_SUBCMD_SET_IMU_SENSITIVITY = 0x41;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:66:17: error: 'JC_SUBCMD_GET_PLAYER_LIGHTS' defined but not used [-Werror=unused-const-variable=]
66 | static const u8 JC_SUBCMD_GET_PLAYER_LIGHTS = 0x31;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:64:17: error: 'JC_SUBCMD_SET_MCU_STATE' defined but not used [-Werror=unused-const-variable=]
64 | static const u8 JC_SUBCMD_SET_MCU_STATE = 0x22;
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:63:17: error: 'JC_SUBCMD_SET_MCU_CONFIG' defined but not used [-Werror=unused-const-variable=]
63 | static const u8 JC_SUBCMD_SET_MCU_CONFIG = 0x21;
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:62:17: error: 'JC_SUBCMD_RESET_MCU' defined but not used [-Werror=unused-const-variable=]
62 | static const u8 JC_SUBCMD_RESET_MCU = 0x20;
| ^~~~~~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:61:17: error: 'JC_SUBCMD_SPI_FLASH_WRITE' defined but not used [-Werror=unused-const-variable=]
61 | static const u8 JC_SUBCMD_SPI_FLASH_WRITE = 0x11;
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:59:17: error: 'JC_SUBCMD_LOW_POWER_MODE' defined but not used [-Werror=unused-const-variable=]
59 | static const u8 JC_SUBCMD_LOW_POWER_MODE = 0x08;
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:58:17: error: 'JC_SUBCMD_RESET_PAIRING_INFO' defined but not used [-Werror=unused-const-variable=]
58 | static const u8 JC_SUBCMD_RESET_PAIRING_INFO = 0x07;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:57:17: error: 'JC_SUBCMD_SET_HCI_STATE' defined but not used [-Werror=unused-const-variable=]
57 | static const u8 JC_SUBCMD_SET_HCI_STATE = 0x06;
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:56:17: error: 'JC_SUBCMD_GET_PAGE_LIST_STATE' defined but not used [-Werror=unused-const-variable=]
56 | static const u8 JC_SUBCMD_GET_PAGE_LIST_STATE = 0x05;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:55:17: error: 'JC_SUBCMD_TRIGGERS_ELAPSED' defined but not used [-Werror=unused-const-variable=]
55 | static const u8 JC_SUBCMD_TRIGGERS_ELAPSED = 0x04;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:52:17: error: 'JC_SUBCMD_MANUAL_BT_PAIRING' defined but not used [-Werror=unused-const-variable=]
52 | static const u8 JC_SUBCMD_MANUAL_BT_PAIRING = 0x01;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:51:17: error: 'JC_SUBCMD_STATE' defined but not used [-Werror=unused-const-variable=]
51 | static const u8 JC_SUBCMD_STATE /*= 0x00*/;
| ^~~~~~~~~~~~~~~
drivers/hid/hid-nintendo-switch.c:47:17: error: 'JC_OUTPUT_MCU_DATA' defined but not used [-Werror=unused-const-variable=]
47 | static const u8 JC_OUTPUT_MCU_DATA = 0x11;
| ^~~~~~~~~~~~~~~~~~
vim +1878 drivers/hid/hid-nintendo-switch.c
1827
1828 static DEFINE_MUTEX(joycon_input_num_mutex);
1829 static int joycon_leds_create(struct joycon_ctlr *ctlr)
1830 {
1831 struct hid_device *hdev = ctlr->hdev;
1832 struct device *dev = &hdev->dev;
1833 const char *d_name = dev_name(dev);
1834 struct led_classdev *led;
1835 char *name;
1836 int ret = 0;
1837 int i;
1838 static int input_num = 1;
1839
1840 /* Set the default controller player leds based on controller number */
1841 mutex_lock(&joycon_input_num_mutex);
1842 mutex_lock(&ctlr->output_mutex);
1843 ret = joycon_set_player_leds(ctlr, 0, 0xF >> (4 - input_num));
1844 if (ret)
1845 hid_warn(ctlr->hdev, "Failed to set leds; ret=%d\n", ret);
1846 mutex_unlock(&ctlr->output_mutex);
1847
1848 /* configure the player LEDs */
1849 for (i = 0; i < JC_NUM_LEDS; i++) {
1850 name = devm_kasprintf(dev, GFP_KERNEL, "%s:%s:%s",
1851 d_name,
1852 "green",
1853 joycon_player_led_names[i]);
1854 if (!name)
1855 return -ENOMEM;
1856
1857 led = &ctlr->leds[i];
1858 led->name = name;
1859 led->brightness = ((i + 1) <= input_num) ? 1 : 0;
1860 led->max_brightness = 1;
1861 led->brightness_set_blocking =
1862 joycon_player_led_brightness_set;
1863 led->flags = LED_CORE_SUSPENDRESUME | LED_HW_PLUGGABLE;
1864
1865 ret = devm_led_classdev_register(&hdev->dev, led);
1866 if (ret) {
1867 hid_err(hdev, "Failed registering %s LED\n", led->name);
1868 return ret;
1869 }
1870 }
1871
1872 if (++input_num > 4)
1873 input_num = 1;
1874 mutex_unlock(&joycon_input_num_mutex);
1875
1876 /* configure the home LED */
1877 if (jc_type_has_right(ctlr)) {
> 1878 name = devm_kasprintf(dev, GFP_KERNEL, "%s:%s:%s",
1879 d_name,
1880 "blue",
1881 LED_FUNCTION_PLAYER5);
1882 if (!name)
1883 return -ENOMEM;
1884
1885 led = &ctlr->home_led;
1886 led->name = name;
1887 led->brightness = 0;
1888 led->max_brightness = 0xF;
1889 led->brightness_set_blocking = joycon_home_led_brightness_set;
1890 led->flags = LED_CORE_SUSPENDRESUME | LED_HW_PLUGGABLE;
1891 ret = devm_led_classdev_register(&hdev->dev, led);
1892 if (ret) {
1893 hid_err(hdev, "Failed registering home led\n");
1894 return ret;
1895 }
1896 /* Set the home LED to 0 as default state */
1897 ret = joycon_home_led_brightness_set(led, 0);
1898 if (ret) {
1899 hid_err(hdev, "Failed to set home LED dflt; ret=%d\n",
1900 ret);
1901 return ret;
1902 }
1903 }
1904
1905 return 0;
1906 }
1907
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (66028 bytes)
Powered by blists - more mailing lists