fs/io_uring.c:5999:2: warning: Redundant assignment of 'req' to itself. [selfAssignment]
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: c5d9ae265b105d9a67575fb67bd4650a6fc08e25
commit: a3dbdf54da80326fd12bc11ad75ecd699a82374f io_uring: refactor io_get_sequence()
date: 8 months ago
compiler: powerpc64-linux-gcc (GCC) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
cppcheck warnings: (new ones prefixed by >>)
>> kernel/irq/proc.c:357:2: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
sprintf(name, "%d", irq);
^
>> fs/io_uring.c:5999:2: warning: Redundant assignment of 'req' to itself. [selfAssignment]
io_for_each_link(req, req)
^
cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
>> kernel/irq/proc.c:357:2: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
sprintf(name, "%d", irq);
^
>> fs/io_uring.c:5305:19: warning: Uninitialized variable: req [uninitvar]
if (sqe_addr != req->user_data)
^
fs/io_uring.c:5309:10: warning: Uninitialized variable: req [uninitvar]
return req;
^
fs/io_uring.c:9491:46: warning: Uninitialized variable: req [uninitvar]
seq_printf(m, " op=%d, task_works=%dn", req->opcode,
^
fs/io_uring.c:9492:6: warning: Uninitialized variable: req [uninitvar]
req->task->task_works != NULL);
^
vim +/req +5999 fs/io_uring.c
5993
5994 static u32 io_get_sequence(struct io_kiocb *req)
5995 {
5996 u32 seq = req->ctx->cached_sq_head;
5997
5998 /* need original cached_sq_head, but it was increased for each req */
> 5999 io_for_each_link(req, req)
6000 seq--;
6001 return seq;
6002 }
6003
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months
Re: [PATCH] platform/chrome: cros_ec: honor acpi=off
by kernel test robot
Hi Tong,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on chrome-platform/for-next]
[also build test WARNING on v5.17-rc4 next-20220216]
[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/Tong-Zhang/platform-chrome-cros_...
base: https://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git for-next
config: i386-randconfig-a001 (https://download.01.org/0day-ci/archive/20220216/202202161903.6YHDLR8F-lk...)
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/66345a4aecd6e4acba257476c6e44559f...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Tong-Zhang/platform-chrome-cros_ec-honor-acpi-off/20220216-142709
git checkout 66345a4aecd6e4acba257476c6e44559fccca143
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/platform/chrome/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/platform/chrome/cros_ec_lpc.c: In function 'cros_ec_lpc_init':
>> drivers/platform/chrome/cros_ec_lpc.c:553:6: warning: the address of 'acpi_disable' will always evaluate as 'true' [-Waddress]
553 | if (acpi_disable)
| ^~~~~~~~~~~~
vim +553 drivers/platform/chrome/cros_ec_lpc.c
547
548 static int __init cros_ec_lpc_init(void)
549 {
550 int ret;
551 acpi_status status;
552
> 553 if (acpi_disable)
554 return -ENODEV;
555
556 status = acpi_get_devices(ACPI_DRV_NAME, cros_ec_lpc_parse_device,
557 &cros_ec_lpc_acpi_device_found, NULL);
558 if (ACPI_FAILURE(status))
559 pr_warn(DRV_NAME ": Looking for %s failed\n", ACPI_DRV_NAME);
560
561 if (!cros_ec_lpc_acpi_device_found &&
562 !dmi_check_system(cros_ec_lpc_dmi_table)) {
563 pr_err(DRV_NAME ": unsupported system.\n");
564 return -ENODEV;
565 }
566
567 cros_ec_lpc_mec_init(EC_HOST_CMD_REGION0,
568 EC_LPC_ADDR_MEMMAP + EC_MEMMAP_SIZE);
569
570 /* Register the driver */
571 ret = platform_driver_register(&cros_ec_lpc_driver);
572 if (ret) {
573 pr_err(DRV_NAME ": can't register driver: %d\n", ret);
574 cros_ec_lpc_mec_destroy();
575 return ret;
576 }
577
578 if (!cros_ec_lpc_acpi_device_found) {
579 /* Register the device, and it'll get hooked up automatically */
580 ret = platform_device_register(&cros_ec_lpc_device);
581 if (ret) {
582 pr_err(DRV_NAME ": can't register device: %d\n", ret);
583 platform_driver_unregister(&cros_ec_lpc_driver);
584 cros_ec_lpc_mec_destroy();
585 }
586 }
587
588 return ret;
589 }
590
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months
Re: [PATCH] input: da7280: Make use of the helper function dev_err_probe()
by kernel test robot
Hi zhaoxiao,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on dtor-input/next]
[also build test ERROR on v5.17-rc4 next-20220215]
[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/zhaoxiao/input-da7280-Make-use-o...
base: https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
config: sparc-randconfig-r015-20220216 (https://download.01.org/0day-ci/archive/20220216/202202161735.VuhKajhC-lk...)
compiler: sparc64-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/b2755b400194965e54d346dd316d62002...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review zhaoxiao/input-da7280-Make-use-of-the-helper-function-dev_err_probe/20220216-134841
git checkout b2755b400194965e54d346dd316d62002ce8cde3
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=sparc SHELL=/bin/bash drivers/input/misc/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/input/misc/da7280.c: In function 'da7280_probe':
drivers/input/misc/da7280.c:1150:27: warning: unused variable 'ff' [-Wunused-variable]
1150 | struct ff_device *ff;
| ^~
drivers/input/misc/da7280.c:1148:27: warning: unused variable 'input_dev' [-Wunused-variable]
1148 | struct input_dev *input_dev;
| ^~~~~~~~~
In file included from include/linux/mm_types.h:17,
from include/linux/mmzone.h:21,
from include/linux/gfp.h:6,
from include/linux/radix-tree.h:12,
from include/linux/idr.h:15,
from include/linux/kernfs.h:13,
from include/linux/sysfs.h:16,
from include/linux/kobject.h:20,
from include/linux/of.h:17,
from include/linux/irqdomain.h:35,
from include/linux/acpi.h:13,
from include/linux/i2c.h:13,
from drivers/input/misc/da7280.c:12:
drivers/input/misc/da7280.c: At top level:
include/linux/workqueue.h:225:9: error: expected identifier or '(' before 'do'
225 | do { \
| ^~
include/linux/workqueue.h:245:9: note: in expansion of macro '__INIT_WORK'
245 | __INIT_WORK((_work), (_func), 0)
| ^~~~~~~~~~~
drivers/input/misc/da7280.c:1193:9: note: in expansion of macro 'INIT_WORK'
1193 | INIT_WORK(&haptics->work, da7280_haptic_work);
| ^~~~~~~~~
include/linux/workqueue.h:233:11: error: expected identifier or '(' before 'while'
233 | } while (0)
| ^~~~~
include/linux/workqueue.h:245:9: note: in expansion of macro '__INIT_WORK'
245 | __INIT_WORK((_work), (_func), 0)
| ^~~~~~~~~~~
drivers/input/misc/da7280.c:1193:9: note: in expansion of macro 'INIT_WORK'
1193 | INIT_WORK(&haptics->work, da7280_haptic_work);
| ^~~~~~~~~
drivers/input/misc/da7280.c:1195:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
1195 | haptics->client = client;
| ^~
drivers/input/misc/da7280.c:1196:9: warning: data definition has no type or storage class
1196 | i2c_set_clientdata(client, haptics);
| ^~~~~~~~~~~~~~~~~~
drivers/input/misc/da7280.c:1196:9: error: type defaults to 'int' in declaration of 'i2c_set_clientdata' [-Werror=implicit-int]
drivers/input/misc/da7280.c:1196:9: warning: parameter names (without types) in function declaration
drivers/input/misc/da7280.c:1196:9: error: conflicting types for 'i2c_set_clientdata'; have 'int()'
In file included from drivers/input/misc/da7280.c:12:
include/linux/i2c.h:376:20: note: previous definition of 'i2c_set_clientdata' with type 'void(struct i2c_client *, void *)'
376 | static inline void i2c_set_clientdata(struct i2c_client *client, void *data)
| ^~~~~~~~~~~~~~~~~~
drivers/input/misc/da7280.c:1198:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
1198 | haptics->regmap = devm_regmap_init_i2c(client,
| ^~
In file included from drivers/input/misc/da7280.c:17:
include/linux/regmap.h:676:10: error: expected identifier or '(' before ')' token
676 | }) \
| ^
include/linux/regmap.h:914:9: note: in expansion of macro '__regmap_lockdep_wrapper'
914 | __regmap_lockdep_wrapper(__devm_regmap_init_i2c, #config, \
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/input/misc/da7280.c:1198:27: note: in expansion of macro 'devm_regmap_init_i2c'
1198 | haptics->regmap = devm_regmap_init_i2c(client,
| ^~~~~~~~~~~~~~~~~~~~
drivers/input/misc/da7280.c:1200:9: warning: data definition has no type or storage class
1200 | error = PTR_ERR_OR_ZERO(haptics->regmap);
| ^~~~~
drivers/input/misc/da7280.c:1200:9: error: type defaults to 'int' in declaration of 'error' [-Werror=implicit-int]
drivers/input/misc/da7280.c:1200:33: error: 'haptics' undeclared here (not in a function)
1200 | error = PTR_ERR_OR_ZERO(haptics->regmap);
| ^~~~~~~
In file included from include/linux/build_bug.h:5,
from include/linux/bitfield.h:10,
from drivers/input/misc/da7280.c:9:
>> include/linux/compiler.h:56:23: error: expected identifier or '(' before 'if'
56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~
drivers/input/misc/da7280.c:1201:9: note: in expansion of macro 'if'
1201 | if (error) {
| ^~
>> include/linux/compiler.h:72:2: error: expected identifier or '(' before ')' token
72 | })
| ^
include/linux/compiler.h:58:69: note: in expansion of macro '__trace_if_value'
58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~~~~~~~~~~~~~
include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
drivers/input/misc/da7280.c:1201:9: note: in expansion of macro 'if'
1201 | if (error) {
| ^~
drivers/input/misc/da7280.c:1206:9: warning: data definition has no type or storage class
1206 | error = da7280_init(haptics);
| ^~~~~
drivers/input/misc/da7280.c:1206:9: error: type defaults to 'int' in declaration of 'error' [-Werror=implicit-int]
drivers/input/misc/da7280.c:1206:9: error: redefinition of 'error'
drivers/input/misc/da7280.c:1200:9: note: previous definition of 'error' with type 'int'
1200 | error = PTR_ERR_OR_ZERO(haptics->regmap);
| ^~~~~
In file included from include/linux/build_bug.h:5,
from include/linux/bitfield.h:10,
from drivers/input/misc/da7280.c:9:
>> include/linux/compiler.h:56:23: error: expected identifier or '(' before 'if'
56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~
drivers/input/misc/da7280.c:1207:9: note: in expansion of macro 'if'
1207 | if (error) {
| ^~
>> include/linux/compiler.h:72:2: error: expected identifier or '(' before ')' token
72 | })
| ^
include/linux/compiler.h:58:69: note: in expansion of macro '__trace_if_value'
58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~~~~~~~~~~~~~
include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
drivers/input/misc/da7280.c:1207:9: note: in expansion of macro 'if'
1207 | if (error) {
| ^~
drivers/input/misc/da7280.c:1213:9: warning: data definition has no type or storage class
1213 | input_dev = devm_input_allocate_device(dev);
| ^~~~~~~~~
drivers/input/misc/da7280.c:1213:9: error: type defaults to 'int' in declaration of 'input_dev' [-Werror=implicit-int]
drivers/input/misc/da7280.c:1213:48: error: 'dev' undeclared here (not in a function); did you mean 'cdev'?
1213 | input_dev = devm_input_allocate_device(dev);
| ^~~
| cdev
In file included from include/linux/build_bug.h:5,
from include/linux/bitfield.h:10,
from drivers/input/misc/da7280.c:9:
>> include/linux/compiler.h:56:23: error: expected identifier or '(' before 'if'
56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~
drivers/input/misc/da7280.c:1214:9: note: in expansion of macro 'if'
1214 | if (!input_dev) {
| ^~
>> include/linux/compiler.h:72:2: error: expected identifier or '(' before ')' token
72 | })
| ^
include/linux/compiler.h:58:69: note: in expansion of macro '__trace_if_value'
58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~~~~~~~~~~~~~
include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
drivers/input/misc/da7280.c:1214:9: note: in expansion of macro 'if'
1214 | if (!input_dev) {
| ^~
drivers/input/misc/da7280.c:1219:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
1219 | input_dev->name = "da7280-haptic";
| ^~
drivers/input/misc/da7280.c:1220:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
1220 | input_dev->dev.parent = client->dev.parent;
| ^~
drivers/input/misc/da7280.c:1221:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
1221 | input_dev->open = da7280_haptic_open;
| ^~
drivers/input/misc/da7280.c:1222:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
1222 | input_dev->close = da7280_haptic_close;
| ^~
drivers/input/misc/da7280.c:1223:9: warning: data definition has no type or storage class
1223 | input_set_drvdata(input_dev, haptics);
| ^~~~~~~~~~~~~~~~~
drivers/input/misc/da7280.c:1223:9: error: type defaults to 'int' in declaration of 'input_set_drvdata' [-Werror=implicit-int]
drivers/input/misc/da7280.c:1223:9: warning: parameter names (without types) in function declaration
drivers/input/misc/da7280.c:1223:9: error: conflicting types for 'input_set_drvdata'; have 'int()'
In file included from drivers/input/misc/da7280.c:13:
include/linux/input.h:379:20: note: previous definition of 'input_set_drvdata' with type 'void(struct input_dev *, void *)'
379 | static inline void input_set_drvdata(struct input_dev *dev, void *data)
| ^~~~~~~~~~~~~~~~~
drivers/input/misc/da7280.c:1224:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
1224 | haptics->input_dev = input_dev;
| ^~
drivers/input/misc/da7280.c:1226:37: error: expected ')' before '->' token
1226 | input_set_capability(haptics->input_dev, EV_FF, FF_PERIODIC);
| ^~
| )
drivers/input/misc/da7280.c:1227:37: error: expected ')' before '->' token
1227 | input_set_capability(haptics->input_dev, EV_FF, FF_CUSTOM);
| ^~
| )
drivers/input/misc/da7280.c:1228:37: error: expected ')' before '->' token
1228 | input_set_capability(haptics->input_dev, EV_FF, FF_CONSTANT);
| ^~
| )
drivers/input/misc/da7280.c:1229:37: error: expected ')' before '->' token
1229 | input_set_capability(haptics->input_dev, EV_FF, FF_GAIN);
| ^~
| )
drivers/input/misc/da7280.c:1231:9: warning: data definition has no type or storage class
1231 | error = input_ff_create(haptics->input_dev,
| ^~~~~
drivers/input/misc/da7280.c:1231:9: error: type defaults to 'int' in declaration of 'error' [-Werror=implicit-int]
drivers/input/misc/da7280.c:1231:9: error: redefinition of 'error'
drivers/input/misc/da7280.c:1200:9: note: previous definition of 'error' with type 'int'
1200 | error = PTR_ERR_OR_ZERO(haptics->regmap);
| ^~~~~
In file included from include/linux/build_bug.h:5,
from include/linux/bitfield.h:10,
from drivers/input/misc/da7280.c:9:
>> include/linux/compiler.h:56:23: error: expected identifier or '(' before 'if'
56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~
drivers/input/misc/da7280.c:1233:9: note: in expansion of macro 'if'
1233 | if (error) {
| ^~
>> include/linux/compiler.h:72:2: error: expected identifier or '(' before ')' token
72 | })
| ^
include/linux/compiler.h:58:69: note: in expansion of macro '__trace_if_value'
58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~~~~~~~~~~~~~
include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
drivers/input/misc/da7280.c:1233:9: note: in expansion of macro 'if'
1233 | if (error) {
| ^~
drivers/input/misc/da7280.c:1238:9: warning: data definition has no type or storage class
1238 | ff = input_dev->ff;
| ^~
drivers/input/misc/da7280.c:1238:9: error: type defaults to 'int' in declaration of 'ff' [-Werror=implicit-int]
drivers/input/misc/da7280.c:1238:23: error: invalid type argument of '->' (have 'int')
1238 | ff = input_dev->ff;
| ^~
drivers/input/misc/da7280.c:1239:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
1239 | ff->upload = da7280_haptics_upload_effect;
| ^~
drivers/input/misc/da7280.c:1240:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
1240 | ff->playback = da7280_haptics_playback;
| ^~
drivers/input/misc/da7280.c:1242:9: warning: data definition has no type or storage class
1242 | error = input_register_device(input_dev);
| ^~~~~
drivers/input/misc/da7280.c:1242:9: error: type defaults to 'int' in declaration of 'error' [-Werror=implicit-int]
drivers/input/misc/da7280.c:1242:9: error: redefinition of 'error'
drivers/input/misc/da7280.c:1200:9: note: previous definition of 'error' with type 'int'
1200 | error = PTR_ERR_OR_ZERO(haptics->regmap);
| ^~~~~
drivers/input/misc/da7280.c:1242:39: warning: passing argument 1 of 'input_register_device' makes pointer from integer without a cast [-Wint-conversion]
1242 | error = input_register_device(input_dev);
| ^~~~~~~~~
| |
| int
In file included from drivers/input/misc/da7280.c:13:
include/linux/input.h:384:40: note: expected 'struct input_dev *' but argument is of type 'int'
384 | int __must_check input_register_device(struct input_dev *);
| ^~~~~~~~~~~~~~~~~~
drivers/input/misc/da7280.c:1242:17: error: initializer element is not constant
1242 | error = input_register_device(input_dev);
| ^~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/build_bug.h:5,
from include/linux/bitfield.h:10,
from drivers/input/misc/da7280.c:9:
>> include/linux/compiler.h:56:23: error: expected identifier or '(' before 'if'
56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~
drivers/input/misc/da7280.c:1243:9: note: in expansion of macro 'if'
1243 | if (error) {
| ^~
>> include/linux/compiler.h:72:2: error: expected identifier or '(' before ')' token
72 | })
| ^
include/linux/compiler.h:58:69: note: in expansion of macro '__trace_if_value'
58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~~~~~~~~~~~~~
include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
drivers/input/misc/da7280.c:1243:9: note: in expansion of macro 'if'
1243 | if (error) {
| ^~
drivers/input/misc/da7280.c:1248:9: warning: data definition has no type or storage class
1248 | error = devm_request_threaded_irq(dev, client->irq,
| ^~~~~
drivers/input/misc/da7280.c:1248:9: error: type defaults to 'int' in declaration of 'error' [-Werror=implicit-int]
drivers/input/misc/da7280.c:1248:9: error: redefinition of 'error'
drivers/input/misc/da7280.c:1200:9: note: previous definition of 'error' with type 'int'
1200 | error = PTR_ERR_OR_ZERO(haptics->regmap);
| ^~~~~
drivers/input/misc/da7280.c:1248:48: error: 'client' undeclared here (not in a function)
1248 | error = devm_request_threaded_irq(dev, client->irq,
| ^~~~~~
In file included from include/linux/build_bug.h:5,
from include/linux/bitfield.h:10,
from drivers/input/misc/da7280.c:9:
>> include/linux/compiler.h:56:23: error: expected identifier or '(' before 'if'
56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~
drivers/input/misc/da7280.c:1252:9: note: in expansion of macro 'if'
1252 | if (error) {
| ^~
>> include/linux/compiler.h:72:2: error: expected identifier or '(' before ')' token
72 | })
| ^
include/linux/compiler.h:58:69: note: in expansion of macro '__trace_if_value'
58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
| ^~~~~~~~~~~~~~~~
include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
drivers/input/misc/da7280.c:1252:9: note: in expansion of macro 'if'
1252 | if (error) {
| ^~
drivers/input/misc/da7280.c:1258:9: error: expected identifier or '(' before 'return'
1258 | return 0;
| ^~~~~~
drivers/input/misc/da7280.c:1259:1: error: expected identifier or '(' before '}' token
1259 | }
| ^
drivers/input/misc/da7280.c: In function 'da7280_probe':
drivers/input/misc/da7280.c:1191:9: error: control reaches end of non-void function [-Werror=return-type]
1191 | }
| ^
At top level:
drivers/input/misc/da7280.c:715:13: warning: 'da7280_haptic_close' defined but not used [-Wunused-function]
715 | static void da7280_haptic_close(struct input_dev *dev)
| ^~~~~~~~~~~~~~~~~~~
drivers/input/misc/da7280.c:708:12: warning: 'da7280_haptic_open' defined but not used [-Wunused-function]
708 | static int da7280_haptic_open(struct input_dev *dev)
| ^~~~~~~~~~~~~~~~~~
drivers/input/misc/da7280.c:659:12: warning: 'da7280_haptics_playback' defined but not used [-Wunused-function]
659 | static int da7280_haptics_playback(struct input_dev *dev,
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/input/misc/da7280.c:505:12: warning: 'da7280_haptics_upload_effect' defined but not used [-Wunused-function]
505 | static int da7280_haptics_upload_effect(struct input_dev *dev,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/input/misc/da7280.c:493:13: warning: 'da7280_haptic_work' defined but not used [-Wunused-function]
493 | static void da7280_haptic_work(struct work_struct *work)
| ^~~~~~~~~~~~~~~~~~
drivers/input/misc/da7280.c:277:35: warning: 'da7280_haptic_regmap_config' defined but not used [-Wunused-const-variable=]
277 | static const struct regmap_config da7280_haptic_regmap_config = {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +56 include/linux/compiler.h
2bcd521a684cc9 Steven Rostedt 2008-11-21 50
2bcd521a684cc9 Steven Rostedt 2008-11-21 51 #ifdef CONFIG_PROFILE_ALL_BRANCHES
2bcd521a684cc9 Steven Rostedt 2008-11-21 52 /*
2bcd521a684cc9 Steven Rostedt 2008-11-21 53 * "Define 'is'", Bill Clinton
2bcd521a684cc9 Steven Rostedt 2008-11-21 54 * "Define 'if'", Steven Rostedt
2bcd521a684cc9 Steven Rostedt 2008-11-21 55 */
a15fd609ad53a6 Linus Torvalds 2019-03-20 @56 #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
a15fd609ad53a6 Linus Torvalds 2019-03-20 57
a15fd609ad53a6 Linus Torvalds 2019-03-20 58 #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
a15fd609ad53a6 Linus Torvalds 2019-03-20 59
a15fd609ad53a6 Linus Torvalds 2019-03-20 60 #define __trace_if_value(cond) ({ \
2bcd521a684cc9 Steven Rostedt 2008-11-21 61 static struct ftrace_branch_data \
e04462fb82f8dd Miguel Ojeda 2018-09-03 62 __aligned(4) \
33def8498fdde1 Joe Perches 2020-10-21 63 __section("_ftrace_branch") \
a15fd609ad53a6 Linus Torvalds 2019-03-20 64 __if_trace = { \
2bcd521a684cc9 Steven Rostedt 2008-11-21 65 .func = __func__, \
2bcd521a684cc9 Steven Rostedt 2008-11-21 66 .file = __FILE__, \
2bcd521a684cc9 Steven Rostedt 2008-11-21 67 .line = __LINE__, \
2bcd521a684cc9 Steven Rostedt 2008-11-21 68 }; \
a15fd609ad53a6 Linus Torvalds 2019-03-20 69 (cond) ? \
a15fd609ad53a6 Linus Torvalds 2019-03-20 70 (__if_trace.miss_hit[1]++,1) : \
a15fd609ad53a6 Linus Torvalds 2019-03-20 71 (__if_trace.miss_hit[0]++,0); \
a15fd609ad53a6 Linus Torvalds 2019-03-20 @72 })
a15fd609ad53a6 Linus Torvalds 2019-03-20 73
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months
[smfrench-smb3:for-next 6/6] fs/cifs/sess.c:129 cifs_try_adding_channels() warn: inconsistent indenting
by kernel test robot
tree: git://github.com/smfrench/smb3-kernel.git for-next
head: 5279203f772d0e52e17e13bef6b8ea81720caf1d
commit: 5279203f772d0e52e17e13bef6b8ea81720caf1d [6/6] cifs: use a different reconnect helper for non-cifsd threads
config: x86_64-randconfig-m001-20220214 (https://download.01.org/0day-ci/archive/20220216/202202161725.7B3m2CWC-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
smatch warnings:
fs/cifs/sess.c:129 cifs_try_adding_channels() warn: inconsistent indenting
vim +129 fs/cifs/sess.c
118
119 /* returns number of channels added */
120 int cifs_try_adding_channels(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses)
121 {
122 int old_chan_count, new_chan_count;
123 int left;
124 int i = 0;
125 int rc = 0;
126 int tries = 0;
127 struct cifs_server_iface *ifaces = NULL;
128 size_t iface_count;
> 129 dump_stack();
130 if (ses->server->dialect < SMB30_PROT_ID) {
131 cifs_dbg(VFS, "multichannel is not supported on this protocol version, use 3.0 or above\n");
132 return 0;
133 }
134
135 spin_lock(&ses->chan_lock);
136
137 new_chan_count = old_chan_count = ses->chan_count;
138 left = ses->chan_max - ses->chan_count;
139
140 if (left <= 0) {
141 spin_unlock(&ses->chan_lock);
142 cifs_dbg(VFS,
143 "ses already at max_channels (%zu), nothing to open. chan_max %zu\n",
144 ses->chan_max, ses->chan_count);
145 return 0;
146 }
147
148 if (!(ses->server->capabilities & SMB2_GLOBAL_CAP_MULTI_CHANNEL)) {
149 ses->chan_max = 1;
150 spin_unlock(&ses->chan_lock);
151 cifs_dbg(VFS, "server %s does not support multichannel\n", ses->server->hostname);
152 return 0;
153 }
154 spin_unlock(&ses->chan_lock);
155
156 /*
157 * Make a copy of the iface list at the time and use that
158 * instead so as to not hold the iface spinlock for opening
159 * channels
160 */
161 spin_lock(&ses->iface_lock);
162 iface_count = ses->iface_count;
163 if (iface_count <= 0) {
164 spin_unlock(&ses->iface_lock);
165 cifs_dbg(VFS, "no iface list available to open channels\n");
166 return 0;
167 }
168 ifaces = kmemdup(ses->iface_list, iface_count*sizeof(*ifaces),
169 GFP_ATOMIC);
170 if (!ifaces) {
171 spin_unlock(&ses->iface_lock);
172 return 0;
173 }
174 spin_unlock(&ses->iface_lock);
175
176 /*
177 * Keep connecting to same, fastest, iface for all channels as
178 * long as its RSS. Try next fastest one if not RSS or channel
179 * creation fails.
180 */
181 while (left > 0) {
182 struct cifs_server_iface *iface;
183
184 tries++;
185 if (tries > 3*ses->chan_max) {
186 cifs_dbg(FYI, "too many channel open attempts (%d channels left to open)\n",
187 left);
188 break;
189 }
190
191 iface = &ifaces[i];
192 if (is_ses_using_iface(ses, iface) && !iface->rss_capable) {
193 i = (i+1) % iface_count;
194 continue;
195 }
196
197 rc = cifs_ses_add_channel(cifs_sb, ses, iface);
198 if (rc) {
199 cifs_dbg(FYI, "failed to open extra channel on iface#%d rc=%d\n",
200 i, rc);
201 i = (i+1) % iface_count;
202 continue;
203 }
204
205 cifs_dbg(FYI, "successfully opened new channel on iface#%d\n",
206 i);
207 left--;
208 new_chan_count++;
209 }
210
211 kfree(ifaces);
212 return new_chan_count - old_chan_count;
213 }
214
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months
Re: [PATCH] input: da7280: Make use of the helper function dev_err_probe()
by kernel test robot
Hi zhaoxiao,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on dtor-input/next]
[also build test ERROR on v5.17-rc4 next-20220215]
[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/zhaoxiao/input-da7280-Make-use-o...
base: https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
config: nios2-randconfig-r001-20220216 (https://download.01.org/0day-ci/archive/20220216/202202161724.YrwefpTP-lk...)
compiler: nios2-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/b2755b400194965e54d346dd316d62002...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review zhaoxiao/input-da7280-Make-use-of-the-helper-function-dev_err_probe/20220216-134841
git checkout b2755b400194965e54d346dd316d62002ce8cde3
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=nios2 SHELL=/bin/bash drivers/input/misc/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
drivers/input/misc/da7280.c: In function 'da7280_probe':
drivers/input/misc/da7280.c:1150:27: warning: unused variable 'ff' [-Wunused-variable]
1150 | struct ff_device *ff;
| ^~
drivers/input/misc/da7280.c:1148:27: warning: unused variable 'input_dev' [-Wunused-variable]
1148 | struct input_dev *input_dev;
| ^~~~~~~~~
In file included from include/linux/mm_types.h:17,
from include/linux/mmzone.h:21,
from include/linux/gfp.h:6,
from include/linux/radix-tree.h:12,
from include/linux/idr.h:15,
from include/linux/kernfs.h:13,
from include/linux/sysfs.h:16,
from include/linux/kobject.h:20,
from include/linux/of.h:17,
from include/linux/irqdomain.h:35,
from include/linux/acpi.h:13,
from include/linux/i2c.h:13,
from drivers/input/misc/da7280.c:12:
drivers/input/misc/da7280.c: At top level:
>> include/linux/workqueue.h:236:9: error: expected identifier or '(' before 'do'
236 | do { \
| ^~
include/linux/workqueue.h:245:9: note: in expansion of macro '__INIT_WORK'
245 | __INIT_WORK((_work), (_func), 0)
| ^~~~~~~~~~~
drivers/input/misc/da7280.c:1193:9: note: in expansion of macro 'INIT_WORK'
1193 | INIT_WORK(&haptics->work, da7280_haptic_work);
| ^~~~~~~~~
>> include/linux/workqueue.h:241:11: error: expected identifier or '(' before 'while'
241 | } while (0)
| ^~~~~
include/linux/workqueue.h:245:9: note: in expansion of macro '__INIT_WORK'
245 | __INIT_WORK((_work), (_func), 0)
| ^~~~~~~~~~~
drivers/input/misc/da7280.c:1193:9: note: in expansion of macro 'INIT_WORK'
1193 | INIT_WORK(&haptics->work, da7280_haptic_work);
| ^~~~~~~~~
>> drivers/input/misc/da7280.c:1195:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
1195 | haptics->client = client;
| ^~
>> drivers/input/misc/da7280.c:1196:9: warning: data definition has no type or storage class
1196 | i2c_set_clientdata(client, haptics);
| ^~~~~~~~~~~~~~~~~~
>> drivers/input/misc/da7280.c:1196:9: error: type defaults to 'int' in declaration of 'i2c_set_clientdata' [-Werror=implicit-int]
>> drivers/input/misc/da7280.c:1196:9: warning: parameter names (without types) in function declaration
>> drivers/input/misc/da7280.c:1196:9: error: conflicting types for 'i2c_set_clientdata'; have 'int()'
In file included from drivers/input/misc/da7280.c:12:
include/linux/i2c.h:376:20: note: previous definition of 'i2c_set_clientdata' with type 'void(struct i2c_client *, void *)'
376 | static inline void i2c_set_clientdata(struct i2c_client *client, void *data)
| ^~~~~~~~~~~~~~~~~~
drivers/input/misc/da7280.c:1198:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
1198 | haptics->regmap = devm_regmap_init_i2c(client,
| ^~
drivers/input/misc/da7280.c:1200:9: warning: data definition has no type or storage class
1200 | error = PTR_ERR_OR_ZERO(haptics->regmap);
| ^~~~~
>> drivers/input/misc/da7280.c:1200:9: error: type defaults to 'int' in declaration of 'error' [-Werror=implicit-int]
>> drivers/input/misc/da7280.c:1200:33: error: 'haptics' undeclared here (not in a function)
1200 | error = PTR_ERR_OR_ZERO(haptics->regmap);
| ^~~~~~~
>> drivers/input/misc/da7280.c:1201:9: error: expected identifier or '(' before 'if'
1201 | if (error) {
| ^~
drivers/input/misc/da7280.c:1206:9: warning: data definition has no type or storage class
1206 | error = da7280_init(haptics);
| ^~~~~
drivers/input/misc/da7280.c:1206:9: error: type defaults to 'int' in declaration of 'error' [-Werror=implicit-int]
>> drivers/input/misc/da7280.c:1206:9: error: redefinition of 'error'
drivers/input/misc/da7280.c:1200:9: note: previous definition of 'error' with type 'int'
1200 | error = PTR_ERR_OR_ZERO(haptics->regmap);
| ^~~~~
drivers/input/misc/da7280.c:1207:9: error: expected identifier or '(' before 'if'
1207 | if (error) {
| ^~
drivers/input/misc/da7280.c:1213:9: warning: data definition has no type or storage class
1213 | input_dev = devm_input_allocate_device(dev);
| ^~~~~~~~~
>> drivers/input/misc/da7280.c:1213:9: error: type defaults to 'int' in declaration of 'input_dev' [-Werror=implicit-int]
>> drivers/input/misc/da7280.c:1213:48: error: 'dev' undeclared here (not in a function); did you mean 'cdev'?
1213 | input_dev = devm_input_allocate_device(dev);
| ^~~
| cdev
drivers/input/misc/da7280.c:1214:9: error: expected identifier or '(' before 'if'
1214 | if (!input_dev) {
| ^~
drivers/input/misc/da7280.c:1219:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
1219 | input_dev->name = "da7280-haptic";
| ^~
drivers/input/misc/da7280.c:1220:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
1220 | input_dev->dev.parent = client->dev.parent;
| ^~
drivers/input/misc/da7280.c:1221:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
1221 | input_dev->open = da7280_haptic_open;
| ^~
drivers/input/misc/da7280.c:1222:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
1222 | input_dev->close = da7280_haptic_close;
| ^~
drivers/input/misc/da7280.c:1223:9: warning: data definition has no type or storage class
1223 | input_set_drvdata(input_dev, haptics);
| ^~~~~~~~~~~~~~~~~
>> drivers/input/misc/da7280.c:1223:9: error: type defaults to 'int' in declaration of 'input_set_drvdata' [-Werror=implicit-int]
drivers/input/misc/da7280.c:1223:9: warning: parameter names (without types) in function declaration
>> drivers/input/misc/da7280.c:1223:9: error: conflicting types for 'input_set_drvdata'; have 'int()'
In file included from drivers/input/misc/da7280.c:13:
include/linux/input.h:379:20: note: previous definition of 'input_set_drvdata' with type 'void(struct input_dev *, void *)'
379 | static inline void input_set_drvdata(struct input_dev *dev, void *data)
| ^~~~~~~~~~~~~~~~~
drivers/input/misc/da7280.c:1224:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
1224 | haptics->input_dev = input_dev;
| ^~
>> drivers/input/misc/da7280.c:1226:37: error: expected ')' before '->' token
1226 | input_set_capability(haptics->input_dev, EV_FF, FF_PERIODIC);
| ^~
| )
drivers/input/misc/da7280.c:1227:37: error: expected ')' before '->' token
1227 | input_set_capability(haptics->input_dev, EV_FF, FF_CUSTOM);
| ^~
| )
drivers/input/misc/da7280.c:1228:37: error: expected ')' before '->' token
1228 | input_set_capability(haptics->input_dev, EV_FF, FF_CONSTANT);
| ^~
| )
drivers/input/misc/da7280.c:1229:37: error: expected ')' before '->' token
1229 | input_set_capability(haptics->input_dev, EV_FF, FF_GAIN);
| ^~
| )
drivers/input/misc/da7280.c:1231:9: warning: data definition has no type or storage class
1231 | error = input_ff_create(haptics->input_dev,
| ^~~~~
drivers/input/misc/da7280.c:1231:9: error: type defaults to 'int' in declaration of 'error' [-Werror=implicit-int]
drivers/input/misc/da7280.c:1231:9: error: redefinition of 'error'
drivers/input/misc/da7280.c:1200:9: note: previous definition of 'error' with type 'int'
1200 | error = PTR_ERR_OR_ZERO(haptics->regmap);
| ^~~~~
drivers/input/misc/da7280.c:1233:9: error: expected identifier or '(' before 'if'
1233 | if (error) {
| ^~
drivers/input/misc/da7280.c:1238:9: warning: data definition has no type or storage class
1238 | ff = input_dev->ff;
| ^~
>> drivers/input/misc/da7280.c:1238:9: error: type defaults to 'int' in declaration of 'ff' [-Werror=implicit-int]
>> drivers/input/misc/da7280.c:1238:23: error: invalid type argument of '->' (have 'int')
1238 | ff = input_dev->ff;
| ^~
drivers/input/misc/da7280.c:1239:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
1239 | ff->upload = da7280_haptics_upload_effect;
| ^~
drivers/input/misc/da7280.c:1240:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
1240 | ff->playback = da7280_haptics_playback;
| ^~
drivers/input/misc/da7280.c:1242:9: warning: data definition has no type or storage class
1242 | error = input_register_device(input_dev);
| ^~~~~
drivers/input/misc/da7280.c:1242:9: error: type defaults to 'int' in declaration of 'error' [-Werror=implicit-int]
drivers/input/misc/da7280.c:1242:9: error: redefinition of 'error'
drivers/input/misc/da7280.c:1200:9: note: previous definition of 'error' with type 'int'
1200 | error = PTR_ERR_OR_ZERO(haptics->regmap);
| ^~~~~
>> drivers/input/misc/da7280.c:1242:39: warning: passing argument 1 of 'input_register_device' makes pointer from integer without a cast [-Wint-conversion]
1242 | error = input_register_device(input_dev);
| ^~~~~~~~~
| |
| int
In file included from drivers/input/misc/da7280.c:13:
include/linux/input.h:384:40: note: expected 'struct input_dev *' but argument is of type 'int'
384 | int __must_check input_register_device(struct input_dev *);
| ^~~~~~~~~~~~~~~~~~
>> drivers/input/misc/da7280.c:1242:17: error: initializer element is not constant
1242 | error = input_register_device(input_dev);
| ^~~~~~~~~~~~~~~~~~~~~
drivers/input/misc/da7280.c:1243:9: error: expected identifier or '(' before 'if'
1243 | if (error) {
| ^~
drivers/input/misc/da7280.c:1248:9: warning: data definition has no type or storage class
1248 | error = devm_request_threaded_irq(dev, client->irq,
| ^~~~~
drivers/input/misc/da7280.c:1248:9: error: type defaults to 'int' in declaration of 'error' [-Werror=implicit-int]
drivers/input/misc/da7280.c:1248:9: error: redefinition of 'error'
drivers/input/misc/da7280.c:1200:9: note: previous definition of 'error' with type 'int'
1200 | error = PTR_ERR_OR_ZERO(haptics->regmap);
| ^~~~~
drivers/input/misc/da7280.c:1248:48: error: 'client' undeclared here (not in a function)
1248 | error = devm_request_threaded_irq(dev, client->irq,
| ^~~~~~
drivers/input/misc/da7280.c:1252:9: error: expected identifier or '(' before 'if'
1252 | if (error) {
| ^~
drivers/input/misc/da7280.c:1258:9: error: expected identifier or '(' before 'return'
1258 | return 0;
| ^~~~~~
drivers/input/misc/da7280.c:1259:1: error: expected identifier or '(' before '}' token
1259 | }
| ^
drivers/input/misc/da7280.c: In function 'da7280_probe':
drivers/input/misc/da7280.c:1191:9: error: control reaches end of non-void function [-Werror=return-type]
1191 | }
| ^
At top level:
drivers/input/misc/da7280.c:715:13: warning: 'da7280_haptic_close' defined but not used [-Wunused-function]
715 | static void da7280_haptic_close(struct input_dev *dev)
| ^~~~~~~~~~~~~~~~~~~
drivers/input/misc/da7280.c:708:12: warning: 'da7280_haptic_open' defined but not used [-Wunused-function]
708 | static int da7280_haptic_open(struct input_dev *dev)
| ^~~~~~~~~~~~~~~~~~
drivers/input/misc/da7280.c:659:12: warning: 'da7280_haptics_playback' defined but not used [-Wunused-function]
659 | static int da7280_haptics_playback(struct input_dev *dev,
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/input/misc/da7280.c:505:12: warning: 'da7280_haptics_upload_effect' defined but not used [-Wunused-function]
505 | static int da7280_haptics_upload_effect(struct input_dev *dev,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/input/misc/da7280.c:493:13: warning: 'da7280_haptic_work' defined but not used [-Wunused-function]
493 | static void da7280_haptic_work(struct work_struct *work)
| ^~~~~~~~~~~~~~~~~~
drivers/input/misc/da7280.c:277:35: warning: 'da7280_haptic_regmap_config' defined but not used [-Wunused-const-variable=]
277 | static const struct regmap_config da7280_haptic_regmap_config = {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +1195 drivers/input/misc/da7280.c
cd3f609823a5896 Roy Im 2020-11-28 1142
cd3f609823a5896 Roy Im 2020-11-28 1143 static int da7280_probe(struct i2c_client *client,
cd3f609823a5896 Roy Im 2020-11-28 1144 const struct i2c_device_id *id)
cd3f609823a5896 Roy Im 2020-11-28 1145 {
cd3f609823a5896 Roy Im 2020-11-28 1146 struct device *dev = &client->dev;
cd3f609823a5896 Roy Im 2020-11-28 1147 struct da7280_haptic *haptics;
cd3f609823a5896 Roy Im 2020-11-28 1148 struct input_dev *input_dev;
cd3f609823a5896 Roy Im 2020-11-28 1149 struct pwm_state state;
cd3f609823a5896 Roy Im 2020-11-28 1150 struct ff_device *ff;
cd3f609823a5896 Roy Im 2020-11-28 1151 int error;
cd3f609823a5896 Roy Im 2020-11-28 1152
cd3f609823a5896 Roy Im 2020-11-28 1153 if (!client->irq) {
cd3f609823a5896 Roy Im 2020-11-28 1154 dev_err(dev, "No IRQ configured\n");
cd3f609823a5896 Roy Im 2020-11-28 1155 return -EINVAL;
cd3f609823a5896 Roy Im 2020-11-28 1156 }
cd3f609823a5896 Roy Im 2020-11-28 1157
cd3f609823a5896 Roy Im 2020-11-28 1158 haptics = devm_kzalloc(dev, sizeof(*haptics), GFP_KERNEL);
cd3f609823a5896 Roy Im 2020-11-28 1159 if (!haptics)
cd3f609823a5896 Roy Im 2020-11-28 1160 return -ENOMEM;
cd3f609823a5896 Roy Im 2020-11-28 1161
cd3f609823a5896 Roy Im 2020-11-28 1162 haptics->dev = dev;
cd3f609823a5896 Roy Im 2020-11-28 1163
cd3f609823a5896 Roy Im 2020-11-28 1164 da7280_parse_properties(dev, haptics);
cd3f609823a5896 Roy Im 2020-11-28 1165
cd3f609823a5896 Roy Im 2020-11-28 1166 if (haptics->const_op_mode == DA7280_PWM_MODE) {
cd3f609823a5896 Roy Im 2020-11-28 1167 haptics->pwm_dev = devm_pwm_get(dev, NULL);
b2755b400194965 zhaoxiao 2022-02-16 1168 if (IS_ERR(haptics->pwm_dev))
b2755b400194965 zhaoxiao 2022-02-16 1169 return dev_err_probe(dev, PTR_ERR(haptics->pwm_dev),
b2755b400194965 zhaoxiao 2022-02-16 1170 "Unable to request PWM\n");
cd3f609823a5896 Roy Im 2020-11-28 1171 }
cd3f609823a5896 Roy Im 2020-11-28 1172
cd3f609823a5896 Roy Im 2020-11-28 1173 /* Sync up PWM state and ensure it is off. */
cd3f609823a5896 Roy Im 2020-11-28 1174 pwm_init_state(haptics->pwm_dev, &state);
cd3f609823a5896 Roy Im 2020-11-28 1175 state.enabled = false;
cd3f609823a5896 Roy Im 2020-11-28 1176 error = pwm_apply_state(haptics->pwm_dev, &state);
cd3f609823a5896 Roy Im 2020-11-28 1177 if (error) {
cd3f609823a5896 Roy Im 2020-11-28 1178 dev_err(dev, "Failed to apply PWM state: %d\n", error);
cd3f609823a5896 Roy Im 2020-11-28 1179 return error;
cd3f609823a5896 Roy Im 2020-11-28 1180 }
cd3f609823a5896 Roy Im 2020-11-28 1181
cd3f609823a5896 Roy Im 2020-11-28 1182 /*
cd3f609823a5896 Roy Im 2020-11-28 1183 * Check PWM period, PWM freq = 1000000 / state.period.
cd3f609823a5896 Roy Im 2020-11-28 1184 * The valid PWM freq range: 10k ~ 250kHz.
cd3f609823a5896 Roy Im 2020-11-28 1185 */
cd3f609823a5896 Roy Im 2020-11-28 1186 if (state.period > 100000 || state.period < 4000) {
cd3f609823a5896 Roy Im 2020-11-28 1187 dev_err(dev, "Unsupported PWM period: %lld\n",
cd3f609823a5896 Roy Im 2020-11-28 1188 state.period);
cd3f609823a5896 Roy Im 2020-11-28 1189 return -EINVAL;
cd3f609823a5896 Roy Im 2020-11-28 1190 }
cd3f609823a5896 Roy Im 2020-11-28 1191 }
cd3f609823a5896 Roy Im 2020-11-28 1192
cd3f609823a5896 Roy Im 2020-11-28 1193 INIT_WORK(&haptics->work, da7280_haptic_work);
cd3f609823a5896 Roy Im 2020-11-28 1194
cd3f609823a5896 Roy Im 2020-11-28 @1195 haptics->client = client;
cd3f609823a5896 Roy Im 2020-11-28 @1196 i2c_set_clientdata(client, haptics);
cd3f609823a5896 Roy Im 2020-11-28 1197
cd3f609823a5896 Roy Im 2020-11-28 1198 haptics->regmap = devm_regmap_init_i2c(client,
cd3f609823a5896 Roy Im 2020-11-28 1199 &da7280_haptic_regmap_config);
cd3f609823a5896 Roy Im 2020-11-28 @1200 error = PTR_ERR_OR_ZERO(haptics->regmap);
cd3f609823a5896 Roy Im 2020-11-28 @1201 if (error) {
cd3f609823a5896 Roy Im 2020-11-28 1202 dev_err(dev, "Failed to allocate register map: %d\n", error);
cd3f609823a5896 Roy Im 2020-11-28 1203 return error;
cd3f609823a5896 Roy Im 2020-11-28 1204 }
cd3f609823a5896 Roy Im 2020-11-28 1205
cd3f609823a5896 Roy Im 2020-11-28 @1206 error = da7280_init(haptics);
cd3f609823a5896 Roy Im 2020-11-28 1207 if (error) {
cd3f609823a5896 Roy Im 2020-11-28 1208 dev_err(dev, "Failed to initialize device: %d\n", error);
cd3f609823a5896 Roy Im 2020-11-28 1209 return error;
cd3f609823a5896 Roy Im 2020-11-28 1210 }
cd3f609823a5896 Roy Im 2020-11-28 1211
cd3f609823a5896 Roy Im 2020-11-28 1212 /* Initialize input device for haptic device */
cd3f609823a5896 Roy Im 2020-11-28 @1213 input_dev = devm_input_allocate_device(dev);
cd3f609823a5896 Roy Im 2020-11-28 1214 if (!input_dev) {
cd3f609823a5896 Roy Im 2020-11-28 1215 dev_err(dev, "Failed to allocate input device\n");
cd3f609823a5896 Roy Im 2020-11-28 1216 return -ENOMEM;
cd3f609823a5896 Roy Im 2020-11-28 1217 }
cd3f609823a5896 Roy Im 2020-11-28 1218
cd3f609823a5896 Roy Im 2020-11-28 1219 input_dev->name = "da7280-haptic";
cd3f609823a5896 Roy Im 2020-11-28 1220 input_dev->dev.parent = client->dev.parent;
cd3f609823a5896 Roy Im 2020-11-28 1221 input_dev->open = da7280_haptic_open;
cd3f609823a5896 Roy Im 2020-11-28 1222 input_dev->close = da7280_haptic_close;
cd3f609823a5896 Roy Im 2020-11-28 @1223 input_set_drvdata(input_dev, haptics);
cd3f609823a5896 Roy Im 2020-11-28 1224 haptics->input_dev = input_dev;
cd3f609823a5896 Roy Im 2020-11-28 1225
cd3f609823a5896 Roy Im 2020-11-28 @1226 input_set_capability(haptics->input_dev, EV_FF, FF_PERIODIC);
cd3f609823a5896 Roy Im 2020-11-28 1227 input_set_capability(haptics->input_dev, EV_FF, FF_CUSTOM);
cd3f609823a5896 Roy Im 2020-11-28 1228 input_set_capability(haptics->input_dev, EV_FF, FF_CONSTANT);
cd3f609823a5896 Roy Im 2020-11-28 1229 input_set_capability(haptics->input_dev, EV_FF, FF_GAIN);
cd3f609823a5896 Roy Im 2020-11-28 1230
cd3f609823a5896 Roy Im 2020-11-28 1231 error = input_ff_create(haptics->input_dev,
cd3f609823a5896 Roy Im 2020-11-28 1232 DA7280_FF_EFFECT_COUNT_MAX);
cd3f609823a5896 Roy Im 2020-11-28 1233 if (error) {
cd3f609823a5896 Roy Im 2020-11-28 1234 dev_err(dev, "Failed to create FF input device: %d\n", error);
cd3f609823a5896 Roy Im 2020-11-28 1235 return error;
cd3f609823a5896 Roy Im 2020-11-28 1236 }
cd3f609823a5896 Roy Im 2020-11-28 1237
cd3f609823a5896 Roy Im 2020-11-28 @1238 ff = input_dev->ff;
cd3f609823a5896 Roy Im 2020-11-28 1239 ff->upload = da7280_haptics_upload_effect;
cd3f609823a5896 Roy Im 2020-11-28 1240 ff->playback = da7280_haptics_playback;
cd3f609823a5896 Roy Im 2020-11-28 1241
cd3f609823a5896 Roy Im 2020-11-28 @1242 error = input_register_device(input_dev);
cd3f609823a5896 Roy Im 2020-11-28 1243 if (error) {
cd3f609823a5896 Roy Im 2020-11-28 1244 dev_err(dev, "Failed to register input device: %d\n", error);
cd3f609823a5896 Roy Im 2020-11-28 1245 return error;
cd3f609823a5896 Roy Im 2020-11-28 1246 }
cd3f609823a5896 Roy Im 2020-11-28 1247
cd3f609823a5896 Roy Im 2020-11-28 @1248 error = devm_request_threaded_irq(dev, client->irq,
cd3f609823a5896 Roy Im 2020-11-28 1249 NULL, da7280_irq_handler,
cd3f609823a5896 Roy Im 2020-11-28 1250 IRQF_ONESHOT,
cd3f609823a5896 Roy Im 2020-11-28 1251 "da7280-haptics", haptics);
cd3f609823a5896 Roy Im 2020-11-28 1252 if (error) {
cd3f609823a5896 Roy Im 2020-11-28 1253 dev_err(dev, "Failed to request IRQ %d: %d\n",
cd3f609823a5896 Roy Im 2020-11-28 1254 client->irq, error);
cd3f609823a5896 Roy Im 2020-11-28 1255 return error;
cd3f609823a5896 Roy Im 2020-11-28 1256 }
cd3f609823a5896 Roy Im 2020-11-28 1257
cd3f609823a5896 Roy Im 2020-11-28 @1258 return 0;
cd3f609823a5896 Roy Im 2020-11-28 @1259 }
cd3f609823a5896 Roy Im 2020-11-28 1260
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months
Re: [PATCH v6 7/7] kernfs: Replace per-fs rwsem with hashed ones.
by Nathan Chancellor
On Tue, Feb 15, 2022 at 01:19:23AM +0800, kernel test robot wrote:
> Hi Imran,
>
> Thank you for the patch! Perhaps something to improve:
>
> [auto build test WARNING on 6d9bd4ad4ca08b1114e814c2c42383b8b13be631]
>
> url: https://github.com/0day-ci/linux/commits/Imran-Khan/kernfs-Introduce-hash...
> base: 6d9bd4ad4ca08b1114e814c2c42383b8b13be631
> config: hexagon-randconfig-r012-20220213 (https://download.01.org/0day-ci/archive/20220214/202202142322.OezS0EtW-lk...)
> compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project ea071884b0cc7210b3cc5fe858f0e892a779a23b)
> reproduce (this is a W=1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # https://github.com/0day-ci/linux/commit/48eab913f80f1555d57b964ef7cdba17f...
> git remote add linux-review https://github.com/0day-ci/linux
> git fetch --no-tags linux-review Imran-Khan/kernfs-Introduce-hashed-mutexes-to-replace-global-kernfs_open_file_mutex/20220214-200700
> git checkout 48eab913f80f1555d57b964ef7cdba17f5ec5d1f
> # save the config file to linux build tree
> mkdir build_dir
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash fs/kernfs/
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp(a)intel.com>
>
> All warnings (new ones prefixed by >>):
>
> >> fs/kernfs/dir.c:1619:7: warning: variable 'old_parent' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
> if (!new_name)
> ^~~~~~~~~
> fs/kernfs/dir.c:1653:50: note: uninitialized use occurs here
> up_write_kernfs_rwsem_rename_ns(kn, new_parent, old_parent);
> ^~~~~~~~~~
> fs/kernfs/dir.c:1619:3: note: remove the 'if' if its condition is always false
> if (!new_name)
> ^~~~~~~~~~~~~~
> fs/kernfs/dir.c:1612:6: warning: variable 'old_parent' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
> if (kernfs_find_ns(new_parent, new_name, new_ns))
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> fs/kernfs/dir.c:1653:50: note: uninitialized use occurs here
> up_write_kernfs_rwsem_rename_ns(kn, new_parent, old_parent);
> ^~~~~~~~~~
> fs/kernfs/dir.c:1612:2: note: remove the 'if' if its condition is always false
> if (kernfs_find_ns(new_parent, new_name, new_ns))
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> fs/kernfs/dir.c:1607:6: warning: variable 'old_parent' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
> if ((kn->parent == new_parent) && (kn->ns == new_ns) &&
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> fs/kernfs/dir.c:1653:50: note: uninitialized use occurs here
> up_write_kernfs_rwsem_rename_ns(kn, new_parent, old_parent);
> ^~~~~~~~~~
> fs/kernfs/dir.c:1607:2: note: remove the 'if' if its condition is always false
> if ((kn->parent == new_parent) && (kn->ns == new_ns) &&
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> fs/kernfs/dir.c:1602:6: warning: variable 'old_parent' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
> if (!kernfs_active(kn) || !kernfs_active(new_parent) ||
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> fs/kernfs/dir.c:1653:50: note: uninitialized use occurs here
> up_write_kernfs_rwsem_rename_ns(kn, new_parent, old_parent);
> ^~~~~~~~~~
> fs/kernfs/dir.c:1602:2: note: remove the 'if' if its condition is always false
> if (!kernfs_active(kn) || !kernfs_active(new_parent) ||
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >> fs/kernfs/dir.c:1602:6: warning: variable 'old_parent' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized]
> if (!kernfs_active(kn) || !kernfs_active(new_parent) ||
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> fs/kernfs/dir.c:1653:50: note: uninitialized use occurs here
> up_write_kernfs_rwsem_rename_ns(kn, new_parent, old_parent);
> ^~~~~~~~~~
> fs/kernfs/dir.c:1602:6: note: remove the '||' if its condition is always false
> if (!kernfs_active(kn) || !kernfs_active(new_parent) ||
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >> fs/kernfs/dir.c:1602:6: warning: variable 'old_parent' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized]
> if (!kernfs_active(kn) || !kernfs_active(new_parent) ||
> ^~~~~~~~~~~~~~~~~~
> fs/kernfs/dir.c:1653:50: note: uninitialized use occurs here
> up_write_kernfs_rwsem_rename_ns(kn, new_parent, old_parent);
> ^~~~~~~~~~
> fs/kernfs/dir.c:1602:6: note: remove the '||' if its condition is always false
> if (!kernfs_active(kn) || !kernfs_active(new_parent) ||
> ^~~~~~~~~~~~~~~~~~~~~
> fs/kernfs/dir.c:1591:32: note: initialize the variable 'old_parent' to silence this warning
> struct kernfs_node *old_parent;
> ^
> = NULL
> 6 warnings generated.
>
>
> vim +1619 fs/kernfs/dir.c
>
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1580
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1581 /**
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1582 * kernfs_rename_ns - move and rename a kernfs_node
> 324a56e16e44ba Tejun Heo 2013-12-11 1583 * @kn: target node
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1584 * @new_parent: new parent to put @sd under
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1585 * @new_name: new name
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1586 * @new_ns: new namespace tag
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1587 */
> 324a56e16e44ba Tejun Heo 2013-12-11 1588 int kernfs_rename_ns(struct kernfs_node *kn, struct kernfs_node *new_parent,
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1589 const char *new_name, const void *new_ns)
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1590 {
> 3eef34ad7dc369 Tejun Heo 2014-02-07 1591 struct kernfs_node *old_parent;
> 3eef34ad7dc369 Tejun Heo 2014-02-07 1592 const char *old_name = NULL;
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1593 int error;
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1594
> 3eef34ad7dc369 Tejun Heo 2014-02-07 1595 /* can't move or rename root */
> 3eef34ad7dc369 Tejun Heo 2014-02-07 1596 if (!kn->parent)
> 3eef34ad7dc369 Tejun Heo 2014-02-07 1597 return -EINVAL;
> 3eef34ad7dc369 Tejun Heo 2014-02-07 1598
> 48eab913f80f15 Imran Khan 2022-02-14 1599 down_write_kernfs_rwsem_rename_ns(kn, kn->parent, new_parent);
> 798c75a0d44cdb Greg Kroah-Hartman 2014-01-13 1600
> d0ae3d4347ee02 Tejun Heo 2013-12-11 1601 error = -ENOENT;
> ea015218f2f7ac Eric W. Biederman 2015-05-13 @1602 if (!kernfs_active(kn) || !kernfs_active(new_parent) ||
> ea015218f2f7ac Eric W. Biederman 2015-05-13 1603 (new_parent->flags & KERNFS_EMPTY_DIR))
> d0ae3d4347ee02 Tejun Heo 2013-12-11 1604 goto out;
> d0ae3d4347ee02 Tejun Heo 2013-12-11 1605
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1606 error = 0;
> adc5e8b58f4886 Tejun Heo 2013-12-11 1607 if ((kn->parent == new_parent) && (kn->ns == new_ns) &&
> adc5e8b58f4886 Tejun Heo 2013-12-11 1608 (strcmp(kn->name, new_name) == 0))
> 798c75a0d44cdb Greg Kroah-Hartman 2014-01-13 1609 goto out; /* nothing to rename */
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1610
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1611 error = -EEXIST;
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1612 if (kernfs_find_ns(new_parent, new_name, new_ns))
> 798c75a0d44cdb Greg Kroah-Hartman 2014-01-13 1613 goto out;
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1614
> 324a56e16e44ba Tejun Heo 2013-12-11 1615 /* rename kernfs_node */
> adc5e8b58f4886 Tejun Heo 2013-12-11 1616 if (strcmp(kn->name, new_name) != 0) {
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1617 error = -ENOMEM;
> 75287a677ba1be Andrzej Hajda 2015-02-13 1618 new_name = kstrdup_const(new_name, GFP_KERNEL);
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 @1619 if (!new_name)
> 798c75a0d44cdb Greg Kroah-Hartman 2014-01-13 1620 goto out;
> 3eef34ad7dc369 Tejun Heo 2014-02-07 1621 } else {
> 3eef34ad7dc369 Tejun Heo 2014-02-07 1622 new_name = NULL;
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1623 }
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1624
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1625 /*
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1626 * Move to the appropriate place in the appropriate directories rbtree.
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1627 */
> c637b8acbe079e Tejun Heo 2013-12-11 1628 kernfs_unlink_sibling(kn);
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1629 kernfs_get(new_parent);
> 3eef34ad7dc369 Tejun Heo 2014-02-07 1630
> 3eef34ad7dc369 Tejun Heo 2014-02-07 1631 /* rename_lock protects ->parent and ->name accessors */
> 3eef34ad7dc369 Tejun Heo 2014-02-07 1632 spin_lock_irq(&kernfs_rename_lock);
> 3eef34ad7dc369 Tejun Heo 2014-02-07 1633
> 3eef34ad7dc369 Tejun Heo 2014-02-07 1634 old_parent = kn->parent;
> adc5e8b58f4886 Tejun Heo 2013-12-11 1635 kn->parent = new_parent;
> 3eef34ad7dc369 Tejun Heo 2014-02-07 1636
> 3eef34ad7dc369 Tejun Heo 2014-02-07 1637 kn->ns = new_ns;
> 3eef34ad7dc369 Tejun Heo 2014-02-07 1638 if (new_name) {
> 3eef34ad7dc369 Tejun Heo 2014-02-07 1639 old_name = kn->name;
> 3eef34ad7dc369 Tejun Heo 2014-02-07 1640 kn->name = new_name;
> 3eef34ad7dc369 Tejun Heo 2014-02-07 1641 }
> 3eef34ad7dc369 Tejun Heo 2014-02-07 1642
> 3eef34ad7dc369 Tejun Heo 2014-02-07 1643 spin_unlock_irq(&kernfs_rename_lock);
> 3eef34ad7dc369 Tejun Heo 2014-02-07 1644
> 9561a8961c708f Tejun Heo 2014-02-10 1645 kn->hash = kernfs_name_hash(kn->name, kn->ns);
> c637b8acbe079e Tejun Heo 2013-12-11 1646 kernfs_link_sibling(kn);
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1647
> 3eef34ad7dc369 Tejun Heo 2014-02-07 1648 kernfs_put(old_parent);
> 75287a677ba1be Andrzej Hajda 2015-02-13 1649 kfree_const(old_name);
> 3eef34ad7dc369 Tejun Heo 2014-02-07 1650
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1651 error = 0;
> ae34372eb8408b Tejun Heo 2014-01-10 1652 out:
> 48eab913f80f15 Imran Khan 2022-02-14 1653 up_write_kernfs_rwsem_rename_ns(kn, new_parent, old_parent);
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1654 return error;
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1655 }
> fd7b9f7b9776b1 Tejun Heo 2013-11-28 1656
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
>
I am forwarding this along as a reply to the original posting so that
this patch series is not picked up in its current form. This warning
looks legitimate to me and it will break allmodconfig due to -Werror.
Intel folks, why did this get sent to the author privately, rather than
as a reply to the original posting, given the patch is still in review?
Cheers,
Nathan
7 months
Re: [PATCH v4] mm: Uninline copy_overflow()
by kernel test robot
Hi Christophe,
I love your patch! Yet something to improve:
[auto build test ERROR on linux/master]
[also build test ERROR on linus/master v5.17-rc3]
[cannot apply to hnaz-mm/master next-20220211]
[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/Christophe-Leroy/mm-Uninline-cop...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 2c271fe77d52a0555161926c232cd5bc07178b39
config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20220213/202202130121.dZLDqfpe-lk...)
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/cf4474ac62f0332bd9d39f9dd74dbb5af...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Christophe-Leroy/mm-Uninline-copy_overflow/20220212-155040
git checkout cf4474ac62f0332bd9d39f9dd74dbb5afce9a7a4
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from arch/x86/include/asm/preempt.h:7,
from include/linux/preempt.h:78,
from include/linux/percpu.h:6,
from include/linux/context_tracking_state.h:5,
from include/linux/hardirq.h:5,
from drivers/net/ethernet/mellanox/mlx4/cq.c:37:
In function 'check_copy_size',
inlined from 'copy_to_user' at include/linux/uaccess.h:199:6,
inlined from 'mlx4_init_user_cqes' at drivers/net/ethernet/mellanox/mlx4/cq.c:317:9,
inlined from 'mlx4_cq_alloc' at drivers/net/ethernet/mellanox/mlx4/cq.c:394:10:
>> include/linux/thread_info.h:228:4: error: call to '__bad_copy_from' declared with attribute error: copy source size is too small
228 | __bad_copy_from();
| ^~~~~~~~~~~~~~~~~
vim +/__bad_copy_from +228 include/linux/thread_info.h
b0377fedb65280 Al Viro 2017-06-29 219
9dd819a15162f8 Kees Cook 2019-09-25 220 static __always_inline __must_check bool
b0377fedb65280 Al Viro 2017-06-29 221 check_copy_size(const void *addr, size_t bytes, bool is_source)
b0377fedb65280 Al Viro 2017-06-29 222 {
c80d92fbb67b2c Kees Cook 2021-06-17 223 int sz = __builtin_object_size(addr, 0);
b0377fedb65280 Al Viro 2017-06-29 224 if (unlikely(sz >= 0 && sz < bytes)) {
b0377fedb65280 Al Viro 2017-06-29 225 if (!__builtin_constant_p(bytes))
b0377fedb65280 Al Viro 2017-06-29 226 copy_overflow(sz, bytes);
b0377fedb65280 Al Viro 2017-06-29 227 else if (is_source)
b0377fedb65280 Al Viro 2017-06-29 @228 __bad_copy_from();
b0377fedb65280 Al Viro 2017-06-29 229 else
b0377fedb65280 Al Viro 2017-06-29 230 __bad_copy_to();
b0377fedb65280 Al Viro 2017-06-29 231 return false;
b0377fedb65280 Al Viro 2017-06-29 232 }
6d13de1489b6bf Kees Cook 2019-12-04 233 if (WARN_ON_ONCE(bytes > INT_MAX))
6d13de1489b6bf Kees Cook 2019-12-04 234 return false;
b0377fedb65280 Al Viro 2017-06-29 235 check_object_size(addr, bytes, is_source);
b0377fedb65280 Al Viro 2017-06-29 236 return true;
b0377fedb65280 Al Viro 2017-06-29 237 }
b0377fedb65280 Al Viro 2017-06-29 238
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months