[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202304301500.Ep5XviHQ-lkp@intel.com>
Date: Sun, 30 Apr 2023 15:06:31 +0800
From: kernel test robot <lkp@...el.com>
To: Thomas Weißschuh <linux@...ssschuh.net>,
Sebastian Reichel <sre@...nel.org>
Cc: oe-kbuild-all@...ts.linux.dev, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org,
Thomas Weißschuh <linux@...ssschuh.net>
Subject: Re: [PATCH] power: supply: remove unneeded include of linux/leds.h
Hi Thomas,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 825a0714d2b3883d4f8ff64f6933fb73ee3f1834]
url: https://github.com/intel-lab-lkp/linux/commits/Thomas-Wei-schuh/power-supply-remove-unneeded-include-of-linux-leds-h/20230430-141232
base: 825a0714d2b3883d4f8ff64f6933fb73ee3f1834
patch link: https://lore.kernel.org/r/20230212-include-power_supply-leds-v1-1-7adbf7424002%40weissschuh.net
patch subject: [PATCH] power: supply: remove unneeded include of linux/leds.h
config: x86_64-defconfig (https://download.01.org/0day-ci/archive/20230430/202304301500.Ep5XviHQ-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/b75095fc2fd15bc4d539656b12200b44a9705959
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Thomas-Wei-schuh/power-supply-remove-unneeded-include-of-linux-leds-h/20230430-141232
git checkout b75095fc2fd15bc4d539656b12200b44a9705959
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 olddefconfig
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/hid/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202304301500.Ep5XviHQ-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/hid/hid-lg4ff.c:1121:30: warning: 'enum led_brightness' declared inside parameter list will not be visible outside of this definition or declaration
1121 | enum led_brightness value)
| ^~~~~~~~~~~~~~
drivers/hid/hid-lg4ff.c:1121:45: error: parameter 2 ('value') has incomplete type
1121 | enum led_brightness value)
| ~~~~~~~~~~~~~~~~~~~~^~~~~
drivers/hid/hid-lg4ff.c:1120:13: error: function declaration isn't a prototype [-Werror=strict-prototypes]
1120 | static void lg4ff_led_set_brightness(struct led_classdev *led_cdev,
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-lg4ff.c: In function 'lg4ff_led_set_brightness':
drivers/hid/hid-lg4ff.c:1123:38: error: invalid use of undefined type 'struct led_classdev'
1123 | struct device *dev = led_cdev->dev->parent;
| ^~
drivers/hid/hid-lg4ff.c:1145:30: error: 'LED_OFF' undeclared (first use in this function)
1145 | if (value == LED_OFF && state) {
| ^~~~~~~
drivers/hid/hid-lg4ff.c:1145:30: note: each undeclared identifier is reported only once for each function it appears in
drivers/hid/hid-lg4ff.c: At top level:
drivers/hid/hid-lg4ff.c:1156:28: error: return type is an incomplete type
1156 | static enum led_brightness lg4ff_led_get_brightness(struct led_classdev *led_cdev)
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-lg4ff.c: In function 'lg4ff_led_get_brightness':
drivers/hid/hid-lg4ff.c:1158:38: error: invalid use of undefined type 'struct led_classdev'
1158 | struct device *dev = led_cdev->dev->parent;
| ^~
drivers/hid/hid-lg4ff.c:1166:24: error: 'LED_OFF' undeclared (first use in this function)
1166 | return LED_OFF;
| ^~~~~~~
drivers/hid/hid-lg4ff.c:1166:24: error: 'return' with a value, in function returning void [-Werror=return-type]
drivers/hid/hid-lg4ff.c:1156:28: note: declared here
1156 | static enum led_brightness lg4ff_led_get_brightness(struct led_classdev *led_cdev)
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-lg4ff.c:1173:24: error: 'return' with a value, in function returning void [-Werror=return-type]
1173 | return LED_OFF;
| ^~~~~~~
drivers/hid/hid-lg4ff.c:1156:28: note: declared here
1156 | static enum led_brightness lg4ff_led_get_brightness(struct led_classdev *led_cdev)
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-lg4ff.c:1182:24: error: 'LED_FULL' undeclared (first use in this function); did you mean 'LED_NUML'?
1182 | return value ? LED_FULL : LED_OFF;
| ^~~~~~~~
| LED_NUML
drivers/hid/hid-lg4ff.c:1182:16: error: 'return' with a value, in function returning void [-Werror=return-type]
1182 | return value ? LED_FULL : LED_OFF;
| ^~~~~
drivers/hid/hid-lg4ff.c:1156:28: note: declared here
1156 | static enum led_brightness lg4ff_led_get_brightness(struct led_classdev *led_cdev)
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-lg4ff.c: In function 'lg4ff_init':
drivers/hid/hid-lg4ff.c:1410:46: error: invalid application of 'sizeof' to incomplete type 'struct led_classdev'
1410 | led = kzalloc(sizeof(struct led_classdev)+name_sz, GFP_KERNEL);
| ^~~~~~
drivers/hid/hid-lg4ff.c:1416:45: error: invalid use of undefined type 'struct led_classdev'
1416 | name = (void *)(&led[1]);
| ^
drivers/hid/hid-lg4ff.c:1418:28: error: invalid use of undefined type 'struct led_classdev'
1418 | led->name = name;
| ^~
drivers/hid/hid-lg4ff.c:1419:28: error: invalid use of undefined type 'struct led_classdev'
1419 | led->brightness = 0;
| ^~
drivers/hid/hid-lg4ff.c:1420:28: error: invalid use of undefined type 'struct led_classdev'
1420 | led->max_brightness = 1;
| ^~
drivers/hid/hid-lg4ff.c:1421:28: error: invalid use of undefined type 'struct led_classdev'
1421 | led->brightness_get = lg4ff_led_get_brightness;
| ^~
drivers/hid/hid-lg4ff.c:1422:28: error: invalid use of undefined type 'struct led_classdev'
1422 | led->brightness_set = lg4ff_led_set_brightness;
| ^~
drivers/hid/hid-lg4ff.c:1425:33: error: implicit declaration of function 'led_classdev_register'; did you mean 'class_register'? [-Werror=implicit-function-declaration]
1425 | error = led_classdev_register(&hid->dev, led);
| ^~~~~~~~~~~~~~~~~~~~~
| class_register
drivers/hid/hid-lg4ff.c:1436:41: error: implicit declaration of function 'led_classdev_unregister'; did you mean 'class_unregister'? [-Werror=implicit-function-declaration]
1436 | led_classdev_unregister(led);
| ^~~~~~~~~~~~~~~~~~~~~~~
| class_unregister
cc1: some warnings being treated as errors
vim +1121 drivers/hid/hid-lg4ff.c
22bcefdc883818 Simon Wood 2012-04-21 1119
22bcefdc883818 Simon Wood 2012-04-21 1120 static void lg4ff_led_set_brightness(struct led_classdev *led_cdev,
22bcefdc883818 Simon Wood 2012-04-21 @1121 enum led_brightness value)
22bcefdc883818 Simon Wood 2012-04-21 1122 {
22bcefdc883818 Simon Wood 2012-04-21 1123 struct device *dev = led_cdev->dev->parent;
ee79a8f840a45d Geliang Tang 2015-12-27 1124 struct hid_device *hid = to_hid_device(dev);
4629fd160f7da9 Axel Lin 2012-09-13 1125 struct lg_drv_data *drv_data = hid_get_drvdata(hid);
22bcefdc883818 Simon Wood 2012-04-21 1126 struct lg4ff_device_entry *entry;
22bcefdc883818 Simon Wood 2012-04-21 1127 int i, state = 0;
22bcefdc883818 Simon Wood 2012-04-21 1128
22bcefdc883818 Simon Wood 2012-04-21 1129 if (!drv_data) {
22bcefdc883818 Simon Wood 2012-04-21 1130 hid_err(hid, "Device data not found.");
22bcefdc883818 Simon Wood 2012-04-21 1131 return;
22bcefdc883818 Simon Wood 2012-04-21 1132 }
22bcefdc883818 Simon Wood 2012-04-21 1133
371a1d9e1fed7d Michal Malý 2015-04-08 1134 entry = drv_data->device_props;
22bcefdc883818 Simon Wood 2012-04-21 1135
22bcefdc883818 Simon Wood 2012-04-21 1136 if (!entry) {
22bcefdc883818 Simon Wood 2012-04-21 1137 hid_err(hid, "Device properties not found.");
22bcefdc883818 Simon Wood 2012-04-21 1138 return;
22bcefdc883818 Simon Wood 2012-04-21 1139 }
22bcefdc883818 Simon Wood 2012-04-21 1140
22bcefdc883818 Simon Wood 2012-04-21 1141 for (i = 0; i < 5; i++) {
72529c65a5399b Michal Malý 2015-04-08 1142 if (led_cdev != entry->wdata.led[i])
22bcefdc883818 Simon Wood 2012-04-21 1143 continue;
72529c65a5399b Michal Malý 2015-04-08 1144 state = (entry->wdata.led_state >> i) & 1;
22bcefdc883818 Simon Wood 2012-04-21 1145 if (value == LED_OFF && state) {
72529c65a5399b Michal Malý 2015-04-08 1146 entry->wdata.led_state &= ~(1 << i);
72529c65a5399b Michal Malý 2015-04-08 1147 lg4ff_set_leds(hid, entry->wdata.led_state);
22bcefdc883818 Simon Wood 2012-04-21 1148 } else if (value != LED_OFF && !state) {
72529c65a5399b Michal Malý 2015-04-08 1149 entry->wdata.led_state |= 1 << i;
72529c65a5399b Michal Malý 2015-04-08 1150 lg4ff_set_leds(hid, entry->wdata.led_state);
22bcefdc883818 Simon Wood 2012-04-21 1151 }
22bcefdc883818 Simon Wood 2012-04-21 1152 break;
22bcefdc883818 Simon Wood 2012-04-21 1153 }
22bcefdc883818 Simon Wood 2012-04-21 1154 }
22bcefdc883818 Simon Wood 2012-04-21 1155
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
Powered by blists - more mailing lists