Re: [PATCH] aio: convert active_reqs into a hashtable
by kernel test robot
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20210914094625.171211-1-someguy(a)effective-light.com>
References: <20210914094625.171211-1-someguy(a)effective-light.com>
TO: Hamza Mahfooz <someguy(a)effective-light.com>
TO: linux-kernel(a)vger.kernel.org
CC: Hamza Mahfooz <someguy(a)effective-light.com>
CC: Benjamin LaHaise <bcrl(a)kvack.org>
CC: Alexander Viro <viro(a)zeniv.linux.org.uk>
CC: linux-aio(a)kvack.org
CC: linux-fsdevel(a)vger.kernel.org
Hi Hamza,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on linux/master v5.15-rc1 next-20210916]
[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/Hamza-Mahfooz/aio-convert-active...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git d0ee23f9d78be5531c4b055ea424ed0b489dfe9b
:::::: branch date: 3 days ago
:::::: commit date: 3 days ago
config: arm-randconfig-c002-20210916 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 8cbbd7e0b2aa21ce7e416cfb63d9965518948c35)
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
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://github.com/0day-ci/linux/commit/ab7dca103bc74aed4baada06420395f4b...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Hamza-Mahfooz/aio-convert-active_reqs-into-a-hashtable/20210914-174924
git checkout ab7dca103bc74aed4baada06420395f4bead4e6c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
17 warnings generated.
Suppressed 17 warnings (17 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
18 warnings generated.
Suppressed 18 warnings (18 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
18 warnings generated.
Suppressed 18 warnings (18 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
drivers/pinctrl/visconti/pinctrl-common.c:224:38: warning: Value stored to 'func' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
const struct visconti_pin_function *func = &priv->devdata->functions[function];
^~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/pinctrl/visconti/pinctrl-common.c:224:38: note: Value stored to 'func' during its initialization is never read
const struct visconti_pin_function *func = &priv->devdata->functions[function];
^~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
20 warnings generated.
fs/aio.c:1543:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
ret = -EINVAL;
^ ~~~~~~~
fs/aio.c:1543:2: note: Value stored to 'ret' is never read
ret = -EINVAL;
^ ~~~~~~~
>> fs/aio.c:2042:36: warning: Dereference of undefined pointer value [clang-analyzer-core.NullDereference]
list = &ctx->active_reqs[hash_min(kiocb->ki_res.obj, ctx->hash_bits)];
^
fs/aio.c:2020:1: note: Calling '__do_sys_io_cancel'
SYSCALL_DEFINE3(io_cancel, aio_context_t, ctx_id, struct iocb __user *, iocb,
^
include/linux/syscalls.h:218:36: note: expanded from macro 'SYSCALL_DEFINE3'
#define SYSCALL_DEFINE3(name, ...) SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/syscalls.h:227:2: note: expanded from macro 'SYSCALL_DEFINEx'
__SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/syscalls.h:248:14: note: expanded from macro '__SYSCALL_DEFINEx'
long ret = __do_sys##name(__MAP(x,__SC_CAST,__VA_ARGS__));\
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
note: expanded from here
fs/aio.c:2024:2: note: 'kiocb' declared without an initial value
struct aio_kiocb *kiocb;
^~~~~~~~~~~~~~~~~~~~~~~
fs/aio.c:2031:15: note: Control jumps to 'case 4:' at line 2031
if (unlikely(get_user(key, &iocb->aio_key)))
^
arch/arm/include/asm/uaccess.h:214:3: note: expanded from macro 'get_user'
__get_user_check(x, p); \
^
arch/arm/include/asm/uaccess.h:179:3: note: expanded from macro '__get_user_check'
switch (sizeof(*(__p))) { \
^
fs/aio.c:2031:15: note: Taking false branch
if (unlikely(get_user(key, &iocb->aio_key)))
^
arch/arm/include/asm/uaccess.h:214:3: note: expanded from macro 'get_user'
__get_user_check(x, p); \
^
arch/arm/include/asm/uaccess.h:193:4: note: expanded from macro '__get_user_check'
if (sizeof((x)) >= 8) \
^
fs/aio.c:2031:15: note: Execution continues on line 2031
if (unlikely(get_user(key, &iocb->aio_key)))
^
arch/arm/include/asm/uaccess.h:214:3: note: expanded from macro 'get_user'
__get_user_check(x, p); \
^
arch/arm/include/asm/uaccess.h:197:4: note: expanded from macro '__get_user_check'
break; \
^
fs/aio.c:2031:6: note: Assuming the condition is false
if (unlikely(get_user(key, &iocb->aio_key)))
^
include/linux/compiler.h:78:22: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~
fs/aio.c:2031:2: note: Taking false branch
if (unlikely(get_user(key, &iocb->aio_key)))
^
fs/aio.c:2033:15: note: Assuming 'key' is equal to 0
if (unlikely(key != KIOCB_KEY))
^
include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
fs/aio.c:2033:2: note: Taking false branch
if (unlikely(key != KIOCB_KEY))
^
fs/aio.c:2037:16: note: 'ctx' is non-null
if (unlikely(!ctx))
^
include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
fs/aio.c:2037:2: note: Taking false branch
if (unlikely(!ctx))
^
fs/aio.c:2042:27: note: '?' condition is false
list = &ctx->active_reqs[hash_min(kiocb->ki_res.obj, ctx->hash_bits)];
^
include/linux/hashtable.h:32:3: note: expanded from macro 'hash_min'
(sizeof(val) <= 4 ? hash_32(val, bits) : hash_long(val, bits))
^
fs/aio.c:2042:36: note: Dereference of undefined pointer value
list = &ctx->active_reqs[hash_min(kiocb->ki_res.obj, ctx->hash_bits)];
^
include/linux/hashtable.h:32:53: note: expanded from macro 'hash_min'
(sizeof(val) <= 4 ? hash_32(val, bits) : hash_long(val, bits))
^~~
include/linux/hash.h:16:38: note: expanded from macro 'hash_long'
#define hash_long(val, bits) hash_32(val, bits)
^~~
Suppressed 18 warnings (17 in non-user code, 1 with check filters).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
19 warnings generated.
drivers/gpio/gpiolib-cdev.c:1266:4: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
ret = -EIO;
^ ~~~~
drivers/gpio/gpiolib-cdev.c:1266:4: note: Value stored to 'ret' is never read
ret = -EIO;
^ ~~~~
drivers/gpio/gpiolib-cdev.c:2243:4: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
ret = -EIO;
^ ~~~~
drivers/gpio/gpiolib-cdev.c:2243:4: note: Value stored to 'ret' is never read
vim +2042 fs/aio.c
c00d2c7e898800 Al Viro 2016-12-20 2009
^1da177e4c3f41 Linus Torvalds 2005-04-16 2010 /* sys_io_cancel:
^1da177e4c3f41 Linus Torvalds 2005-04-16 2011 * Attempts to cancel an iocb previously passed to io_submit. If
^1da177e4c3f41 Linus Torvalds 2005-04-16 2012 * the operation is successfully cancelled, the resulting event is
^1da177e4c3f41 Linus Torvalds 2005-04-16 2013 * copied into the memory pointed to by result without being placed
^1da177e4c3f41 Linus Torvalds 2005-04-16 2014 * into the completion queue and 0 is returned. May fail with
^1da177e4c3f41 Linus Torvalds 2005-04-16 2015 * -EFAULT if any of the data structures pointed to are invalid.
^1da177e4c3f41 Linus Torvalds 2005-04-16 2016 * May fail with -EINVAL if aio_context specified by ctx_id is
^1da177e4c3f41 Linus Torvalds 2005-04-16 2017 * invalid. May fail with -EAGAIN if the iocb specified was not
^1da177e4c3f41 Linus Torvalds 2005-04-16 2018 * cancelled. Will fail with -ENOSYS if not implemented.
^1da177e4c3f41 Linus Torvalds 2005-04-16 2019 */
002c8976ee5377 Heiko Carstens 2009-01-14 2020 SYSCALL_DEFINE3(io_cancel, aio_context_t, ctx_id, struct iocb __user *, iocb,
002c8976ee5377 Heiko Carstens 2009-01-14 2021 struct io_event __user *, result)
^1da177e4c3f41 Linus Torvalds 2005-04-16 2022 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 2023 struct kioctx *ctx;
04b2fa9f8f36ec Christoph Hellwig 2015-02-02 2024 struct aio_kiocb *kiocb;
888933f8fdf06e Christoph Hellwig 2018-05-23 2025 int ret = -EINVAL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 2026 u32 key;
ab7dca103bc74a Hamza Mahfooz 2021-09-14 2027 struct hlist_head *list;
ab7dca103bc74a Hamza Mahfooz 2021-09-14 2028 struct hlist_node *node;
a9339b7855094b Al Viro 2019-03-07 2029 u64 obj = (u64)(unsigned long)iocb;
^1da177e4c3f41 Linus Torvalds 2005-04-16 2030
f3a2752a43de18 Christoph Hellwig 2018-03-30 2031 if (unlikely(get_user(key, &iocb->aio_key)))
^1da177e4c3f41 Linus Torvalds 2005-04-16 2032 return -EFAULT;
f3a2752a43de18 Christoph Hellwig 2018-03-30 2033 if (unlikely(key != KIOCB_KEY))
f3a2752a43de18 Christoph Hellwig 2018-03-30 2034 return -EINVAL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 2035
^1da177e4c3f41 Linus Torvalds 2005-04-16 2036 ctx = lookup_ioctx(ctx_id);
^1da177e4c3f41 Linus Torvalds 2005-04-16 2037 if (unlikely(!ctx))
^1da177e4c3f41 Linus Torvalds 2005-04-16 2038 return -EINVAL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 2039
^1da177e4c3f41 Linus Torvalds 2005-04-16 2040 spin_lock_irq(&ctx->ctx_lock);
ab7dca103bc74a Hamza Mahfooz 2021-09-14 2041
ab7dca103bc74a Hamza Mahfooz 2021-09-14 @2042 list = &ctx->active_reqs[hash_min(kiocb->ki_res.obj, ctx->hash_bits)];
ab7dca103bc74a Hamza Mahfooz 2021-09-14 2043
ab7dca103bc74a Hamza Mahfooz 2021-09-14 2044 hlist_for_each_entry_safe(kiocb, node, list, ki_node) {
a9339b7855094b Al Viro 2019-03-07 2045 if (kiocb->ki_res.obj == obj) {
888933f8fdf06e Christoph Hellwig 2018-05-23 2046 ret = kiocb->ki_cancel(&kiocb->rw);
ab7dca103bc74a Hamza Mahfooz 2021-09-14 2047 hash_del(&kiocb->ki_node);
833f4154ed5602 Al Viro 2019-03-11 2048 break;
833f4154ed5602 Al Viro 2019-03-11 2049 }
888933f8fdf06e Christoph Hellwig 2018-05-23 2050 }
ab7dca103bc74a Hamza Mahfooz 2021-09-14 2051
^1da177e4c3f41 Linus Torvalds 2005-04-16 2052 spin_unlock_irq(&ctx->ctx_lock);
^1da177e4c3f41 Linus Torvalds 2005-04-16 2053
^1da177e4c3f41 Linus Torvalds 2005-04-16 2054 if (!ret) {
bec68faaf3ba74 Kent Overstreet 2013-05-13 2055 /*
bec68faaf3ba74 Kent Overstreet 2013-05-13 2056 * The result argument is no longer used - the io_event is
bec68faaf3ba74 Kent Overstreet 2013-05-13 2057 * always delivered via the ring buffer. -EINPROGRESS indicates
bec68faaf3ba74 Kent Overstreet 2013-05-13 2058 * cancellation is progress:
^1da177e4c3f41 Linus Torvalds 2005-04-16 2059 */
bec68faaf3ba74 Kent Overstreet 2013-05-13 2060 ret = -EINPROGRESS;
^1da177e4c3f41 Linus Torvalds 2005-04-16 2061 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 2062
723be6e39d1425 Kent Overstreet 2013-05-28 2063 percpu_ref_put(&ctx->users);
^1da177e4c3f41 Linus Torvalds 2005-04-16 2064
^1da177e4c3f41 Linus Torvalds 2005-04-16 2065 return ret;
^1da177e4c3f41 Linus Torvalds 2005-04-16 2066 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 2067
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months
drivers/platform/x86/dell/dell-laptop.c:1596:4: warning: Value stored to 'unit' is never read [clang-analyzer-deadcode.DeadStores]
by kernel test robot
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Mario Limonciello <mario.limonciello(a)dell.com>
CC: Hans de Goede <hdegoede(a)redhat.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: bdb575f872175ed0ecf2638369da1cb7a6e86a14
commit: f1e1ea516721d1ea0b21327ff9e6cb2c2bb86e28 platform/x86: Move all dell drivers to their own subdirectory
date: 8 months ago
:::::: branch date: 9 hours ago
:::::: commit date: 8 months ago
config: i386-randconfig-c001-20210916 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 8cbbd7e0b2aa21ce7e416cfb63d9965518948c35)
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://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout f1e1ea516721d1ea0b21327ff9e6cb2c2bb86e28
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
sound/core/device.c:237:2: note: Taking false branch
list_for_each_entry_safe_reverse(dev, next, &card->devices, list)
^
include/linux/list.h:762:13: note: expanded from macro 'list_for_each_entry_safe_reverse'
for (pos = list_last_entry(head, typeof(*pos), member), \
^
include/linux/list.h:533:2: note: expanded from macro 'list_last_entry'
list_entry((ptr)->prev, type, member)
^
include/linux/list.h:511:2: note: expanded from macro 'list_entry'
container_of(ptr, type, member)
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:326:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:314:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:306:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
sound/core/device.c:237:2: note: Loop condition is false. Exiting loop
list_for_each_entry_safe_reverse(dev, next, &card->devices, list)
^
include/linux/list.h:762:13: note: expanded from macro 'list_for_each_entry_safe_reverse'
for (pos = list_last_entry(head, typeof(*pos), member), \
^
include/linux/list.h:533:2: note: expanded from macro 'list_last_entry'
list_entry((ptr)->prev, type, member)
^
include/linux/list.h:511:2: note: expanded from macro 'list_entry'
container_of(ptr, type, member)
^
note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:326:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:314:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:304:2: note: expanded from macro '__compiletime_assert'
do { \
^
sound/core/device.c:237:2: note: Use of memory after it is freed
list_for_each_entry_safe_reverse(dev, next, &card->devices, list)
^
include/linux/list.h:763:7: note: expanded from macro 'list_for_each_entry_safe_reverse'
n = list_prev_entry(pos, member); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/list.h:563:2: note: expanded from macro 'list_prev_entry'
list_entry((pos)->member.prev, typeof(*(pos)), member)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/list.h:511:2: note: expanded from macro 'list_entry'
container_of(ptr, type, member)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:693:25: note: expanded from macro 'container_of'
void *__mptr = (void *)(ptr); \
^~~~~
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
drivers/video/fbdev/core/fbmem.c:809:3: warning: Value stored to 'dst' is never read [clang-analyzer-deadcode.DeadStores]
dst += c;
^ ~
drivers/video/fbdev/core/fbmem.c:809:3: note: Value stored to 'dst' is never read
dst += c;
^ ~
drivers/video/fbdev/core/fbmem.c:887:3: warning: Value stored to 'src' is never read [clang-analyzer-deadcode.DeadStores]
src += c;
^ ~
drivers/video/fbdev/core/fbmem.c:887:3: note: Value stored to 'src' is never read
src += c;
^ ~
Suppressed 7 warnings (5 in non-user code, 2 with check filters).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
>> drivers/platform/x86/dell/dell-laptop.c:1596:4: warning: Value stored to 'unit' is never read [clang-analyzer-deadcode.DeadStores]
unit = KBD_TIMEOUT_SECONDS;
^ ~~~~~~~~~~~~~~~~~~~
drivers/platform/x86/dell/dell-laptop.c:1596:4: note: Value stored to 'unit' is never read
unit = KBD_TIMEOUT_SECONDS;
^ ~~~~~~~~~~~~~~~~~~~
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
5 warnings generated.
Suppressed 5 warnings (5 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
7 warnings generated.
drivers/hwmon/adc128d818.c:218:29: warning: The result of the left shift is undefined because the left operand is negative [clang-analyzer-core.UndefinedBinaryOperatorResult]
data->temp[index] = regval << 1;
~~~~~~ ^
drivers/hwmon/adc128d818.c:207:14: note: Left side of '&&' is false
int index = to_sensor_dev_attr(attr)->index;
^
include/linux/hwmon-sysfs.h:17:2: note: expanded from macro 'to_sensor_dev_attr'
container_of(_dev_attr, struct sensor_device_attribute, dev_attr)
^
include/linux/kernel.h:694:61: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
drivers/hwmon/adc128d818.c:207:14: note: Taking false branch
int index = to_sensor_dev_attr(attr)->index;
^
include/linux/hwmon-sysfs.h:17:2: note: expanded from macro 'to_sensor_dev_attr'
container_of(_dev_attr, struct sensor_device_attribute, dev_attr)
^
include/linux/kernel.h:694:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^
include/linux/compiler_types.h:326:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:314:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:306:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
drivers/hwmon/adc128d818.c:207:14: note: Loop condition is false. Exiting loop
int index = to_sensor_dev_attr(attr)->index;
^
include/linux/hwmon-sysfs.h:17:2: note: expanded from macro 'to_sensor_dev_attr'
container_of(_dev_attr, struct sensor_device_attribute, dev_attr)
^
include/linux/kernel.h:694:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^
include/linux/compiler_types.h:326:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:314:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:304:2: note: expanded from macro '__compiletime_assert'
do { \
^
drivers/hwmon/adc128d818.c:213:6: note: Assuming 'err' is >= 0
if (err < 0)
^~~~~~~
drivers/hwmon/adc128d818.c:213:2: note: Taking false branch
if (err < 0)
^
drivers/hwmon/adc128d818.c:217:21: note: Left side of '||' is false
regval = clamp_val(DIV_ROUND_CLOSEST(val, 1000), -128, 127);
^
include/linux/math.h:89:3: note: expanded from macro 'DIV_ROUND_CLOSEST'
(((typeof(x))-1) > 0 || \
^
drivers/hwmon/adc128d818.c:217:21: note: Left side of '||' is false
regval = clamp_val(DIV_ROUND_CLOSEST(val, 1000), -128, 127);
^
include/linux/math.h:89:3: note: expanded from macro 'DIV_ROUND_CLOSEST'
(((typeof(x))-1) > 0 || \
^
drivers/hwmon/adc128d818.c:217:21: note: Assuming '__x' is <= 0
regval = clamp_val(DIV_ROUND_CLOSEST(val, 1000), -128, 127);
^
include/linux/math.h:91:5: note: expanded from macro 'DIV_ROUND_CLOSEST'
(((__x) > 0) == ((__d) > 0))) ? \
vim +/unit +1596 drivers/platform/x86/dell/dell-laptop.c
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1532
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1533 static ssize_t kbd_led_timeout_store(struct device *dev,
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1534 struct device_attribute *attr,
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1535 const char *buf, size_t count)
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1536 {
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1537 struct kbd_state new_state;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1538 struct kbd_state state;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1539 bool convert;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1540 int value;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1541 int ret;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1542 char ch;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1543 u8 unit;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1544 int i;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1545
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1546 ret = sscanf(buf, "%d %c", &value, &ch);
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1547 if (ret < 1)
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1548 return -EINVAL;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1549 else if (ret == 1)
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1550 ch = 's';
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1551
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1552 if (value < 0)
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1553 return -EINVAL;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1554
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1555 convert = false;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1556
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1557 switch (ch) {
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1558 case 's':
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1559 if (value > kbd_info.seconds)
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1560 convert = true;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1561 unit = KBD_TIMEOUT_SECONDS;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1562 break;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1563 case 'm':
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1564 if (value > kbd_info.minutes)
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1565 convert = true;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1566 unit = KBD_TIMEOUT_MINUTES;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1567 break;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1568 case 'h':
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1569 if (value > kbd_info.hours)
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1570 convert = true;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1571 unit = KBD_TIMEOUT_HOURS;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1572 break;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1573 case 'd':
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1574 if (value > kbd_info.days)
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1575 convert = true;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1576 unit = KBD_TIMEOUT_DAYS;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1577 break;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1578 default:
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1579 return -EINVAL;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1580 }
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1581
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1582 if (quirks && quirks->needs_kbd_timeouts)
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1583 convert = true;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1584
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1585 if (convert) {
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1586 /* Convert value from current units to seconds */
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1587 switch (unit) {
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1588 case KBD_TIMEOUT_DAYS:
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1589 value *= 24;
df561f6688fef7 drivers/platform/x86/dell-laptop.c Gustavo A. R. Silva 2020-08-23 1590 fallthrough;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1591 case KBD_TIMEOUT_HOURS:
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1592 value *= 60;
df561f6688fef7 drivers/platform/x86/dell-laptop.c Gustavo A. R. Silva 2020-08-23 1593 fallthrough;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1594 case KBD_TIMEOUT_MINUTES:
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1595 value *= 60;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 @1596 unit = KBD_TIMEOUT_SECONDS;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1597 }
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1598
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1599 if (quirks && quirks->needs_kbd_timeouts) {
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1600 for (i = 0; quirks->kbd_timeouts[i] != -1; i++) {
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1601 if (value <= quirks->kbd_timeouts[i]) {
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1602 value = quirks->kbd_timeouts[i];
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1603 break;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1604 }
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1605 }
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1606 }
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1607
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1608 if (value <= kbd_info.seconds && kbd_info.seconds) {
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1609 unit = KBD_TIMEOUT_SECONDS;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1610 } else if (value / 60 <= kbd_info.minutes && kbd_info.minutes) {
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1611 value /= 60;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1612 unit = KBD_TIMEOUT_MINUTES;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1613 } else if (value / (60 * 60) <= kbd_info.hours && kbd_info.hours) {
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1614 value /= (60 * 60);
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1615 unit = KBD_TIMEOUT_HOURS;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1616 } else if (value / (60 * 60 * 24) <= kbd_info.days && kbd_info.days) {
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1617 value /= (60 * 60 * 24);
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1618 unit = KBD_TIMEOUT_DAYS;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1619 } else {
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1620 return -EINVAL;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1621 }
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1622 }
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1623
e5bf5df7858e23 drivers/platform/x86/dell-laptop.c Hans de Goede 2017-03-16 1624 mutex_lock(&kbd_led_mutex);
e5bf5df7858e23 drivers/platform/x86/dell-laptop.c Hans de Goede 2017-03-16 1625
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1626 ret = kbd_get_state(&state);
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1627 if (ret)
e5bf5df7858e23 drivers/platform/x86/dell-laptop.c Hans de Goede 2017-03-16 1628 goto out;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1629
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1630 new_state = state;
9216e0dcb5533a drivers/platform/x86/dell-laptop.c Pali Rohár 2017-04-23 1631
9216e0dcb5533a drivers/platform/x86/dell-laptop.c Pali Rohár 2017-04-23 1632 if (kbd_timeout_ac_supported && power_supply_is_system_supplied() > 0) {
9216e0dcb5533a drivers/platform/x86/dell-laptop.c Pali Rohár 2017-04-23 1633 new_state.timeout_value_ac = value;
9216e0dcb5533a drivers/platform/x86/dell-laptop.c Pali Rohár 2017-04-23 1634 new_state.timeout_unit_ac = unit;
9216e0dcb5533a drivers/platform/x86/dell-laptop.c Pali Rohár 2017-04-23 1635 } else {
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1636 new_state.timeout_value = value;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1637 new_state.timeout_unit = unit;
9216e0dcb5533a drivers/platform/x86/dell-laptop.c Pali Rohár 2017-04-23 1638 }
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1639
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1640 ret = kbd_set_state_safe(&new_state, &state);
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1641 if (ret)
e5bf5df7858e23 drivers/platform/x86/dell-laptop.c Hans de Goede 2017-03-16 1642 goto out;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1643
e5bf5df7858e23 drivers/platform/x86/dell-laptop.c Hans de Goede 2017-03-16 1644 ret = count;
e5bf5df7858e23 drivers/platform/x86/dell-laptop.c Hans de Goede 2017-03-16 1645 out:
e5bf5df7858e23 drivers/platform/x86/dell-laptop.c Hans de Goede 2017-03-16 1646 mutex_unlock(&kbd_led_mutex);
e5bf5df7858e23 drivers/platform/x86/dell-laptop.c Hans de Goede 2017-03-16 1647 return ret;
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1648 }
6cff8d60aa0aba drivers/platform/x86/dell-laptop.c Gabriele Mazzotta 2015-02-19 1649
:::::: The code at line 1596 was first introduced by commit
:::::: 6cff8d60aa0aba5583ecda09984dbcb2f24cc28d platform: x86: dell-laptop: Add support for keyboard backlight
:::::: TO: Gabriele Mazzotta <gabriele.mzt(a)gmail.com>
:::::: CC: Darren Hart <dvhart(a)linux.intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months
drivers/pci/pci.c:4050 pci_remap_iospace() warn: impossible condition '(res->end > ~(0)) => (0-u32max > u32max)'
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Christophe Leroy <christophe.leroy(a)csgroup.eu>
CC: Michael Ellerman <mpe(a)ellerman.id.au>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: bdb575f872175ed0ecf2638369da1cb7a6e86a14
commit: 894fa235eb4ca0bfa692dbe4932c2f940cdc8c1e powerpc: inline iomap accessors
date: 10 months ago
:::::: branch date: 9 hours ago
:::::: commit date: 10 months ago
config: powerpc64-randconfig-m031-20210916 (attached as .config)
compiler: powerpc-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>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/pci/pci.c:4050 pci_remap_iospace() warn: impossible condition '(res->end > ~(0)) => (0-u32max > u32max)'
vim +4050 drivers/pci/pci.c
c5076cfe768998 Tomasz Nowicki 2016-05-11 4031
8b921acfeffdb0 Liviu Dudau 2014-09-29 4032 /**
8b921acfeffdb0 Liviu Dudau 2014-09-29 4033 * pci_remap_iospace - Remap the memory mapped I/O space
8b921acfeffdb0 Liviu Dudau 2014-09-29 4034 * @res: Resource describing the I/O space
8b921acfeffdb0 Liviu Dudau 2014-09-29 4035 * @phys_addr: physical address of range to be mapped
8b921acfeffdb0 Liviu Dudau 2014-09-29 4036 *
74356addc0b32e Bjorn Helgaas 2019-01-09 4037 * Remap the memory mapped I/O space described by the @res and the CPU
74356addc0b32e Bjorn Helgaas 2019-01-09 4038 * physical address @phys_addr into virtual address space. Only
74356addc0b32e Bjorn Helgaas 2019-01-09 4039 * architectures that have memory mapped IO functions defined (and the
74356addc0b32e Bjorn Helgaas 2019-01-09 4040 * PCI_IOBASE value defined) should call this function.
8b921acfeffdb0 Liviu Dudau 2014-09-29 4041 */
7b309aef046334 Lorenzo Pieralisi 2017-04-19 4042 int pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr)
8b921acfeffdb0 Liviu Dudau 2014-09-29 4043 {
8b921acfeffdb0 Liviu Dudau 2014-09-29 4044 #if defined(PCI_IOBASE) && defined(CONFIG_MMU)
8b921acfeffdb0 Liviu Dudau 2014-09-29 4045 unsigned long vaddr = (unsigned long)PCI_IOBASE + res->start;
8b921acfeffdb0 Liviu Dudau 2014-09-29 4046
8b921acfeffdb0 Liviu Dudau 2014-09-29 4047 if (!(res->flags & IORESOURCE_IO))
8b921acfeffdb0 Liviu Dudau 2014-09-29 4048 return -EINVAL;
8b921acfeffdb0 Liviu Dudau 2014-09-29 4049
8b921acfeffdb0 Liviu Dudau 2014-09-29 @4050 if (res->end > IO_SPACE_LIMIT)
8b921acfeffdb0 Liviu Dudau 2014-09-29 4051 return -EINVAL;
8b921acfeffdb0 Liviu Dudau 2014-09-29 4052
8b921acfeffdb0 Liviu Dudau 2014-09-29 4053 return ioremap_page_range(vaddr, vaddr + resource_size(res), phys_addr,
8b921acfeffdb0 Liviu Dudau 2014-09-29 4054 pgprot_device(PAGE_KERNEL));
8b921acfeffdb0 Liviu Dudau 2014-09-29 4055 #else
74356addc0b32e Bjorn Helgaas 2019-01-09 4056 /*
74356addc0b32e Bjorn Helgaas 2019-01-09 4057 * This architecture does not have memory mapped I/O space,
74356addc0b32e Bjorn Helgaas 2019-01-09 4058 * so this function should never be called
74356addc0b32e Bjorn Helgaas 2019-01-09 4059 */
8b921acfeffdb0 Liviu Dudau 2014-09-29 4060 WARN_ONCE(1, "This architecture does not support memory mapped I/O\n");
8b921acfeffdb0 Liviu Dudau 2014-09-29 4061 return -ENODEV;
8b921acfeffdb0 Liviu Dudau 2014-09-29 4062 #endif
8b921acfeffdb0 Liviu Dudau 2014-09-29 4063 }
f90b0875463e45 Brian Norris 2017-03-09 4064 EXPORT_SYMBOL(pci_remap_iospace);
8b921acfeffdb0 Liviu Dudau 2014-09-29 4065
:::::: The code at line 4050 was first introduced by commit
:::::: 8b921acfeffdb0b45085da862fc301a2d25ed2cf PCI: Add pci_remap_iospace() to map bus I/O resources
:::::: TO: Liviu Dudau <Liviu.Dudau(a)arm.com>
:::::: CC: Bjorn Helgaas <bhelgaas(a)google.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months
Re: [PATCH v2 04/13] drm/hdcp: Expand HDCP helper library for enable/disable/check
by kernel test robot
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20210915203834.1439-5-sean(a)poorly.run>
References: <20210915203834.1439-5-sean(a)poorly.run>
TO: Sean Paul <sean(a)poorly.run>
TO: dri-devel(a)lists.freedesktop.org
TO: intel-gfx(a)lists.freedesktop.org
TO: freedreno(a)lists.freedesktop.org
CC: swboyd(a)chromium.org
CC: Sean Paul <seanpaul(a)chromium.org>
CC: Maarten Lankhorst <maarten.lankhorst(a)linux.intel.com>
CC: Maxime Ripard <mripard(a)kernel.org>
CC: Thomas Zimmermann <tzimmermann(a)suse.de>
CC: David Airlie <airlied(a)linux.ie>
CC: Daniel Vetter <daniel(a)ffwll.ch>
Hi Sean,
I love your patch! Perhaps something to improve:
[auto build test WARNING on drm-intel/for-linux-next]
[also build test WARNING on drm-tip/drm-tip robh/for-next linus/master v5.15-rc1 next-20210916]
[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/Sean-Paul/drm-hdcp-Pull-HDCP-aut...
base: git://anongit.freedesktop.org/drm-intel for-linux-next
:::::: branch date: 29 hours ago
:::::: commit date: 29 hours ago
config: x86_64-randconfig-m001-20210916 (attached as .config)
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>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/gpu/drm/drm_hdcp.c:1208 drm_hdcp_helper_enable_hdcp() error: uninitialized symbol 'check_link_interval'.
Old smatch warnings:
drivers/gpu/drm/drm_hdcp.c:514 drm_hdcp_atomic_check() warn: inconsistent indenting
vim +/check_link_interval +1208 drivers/gpu/drm/drm_hdcp.c
cbc5065be3a652f Sean Paul 2021-09-15 1126
cbc5065be3a652f Sean Paul 2021-09-15 1127 static int drm_hdcp_helper_enable_hdcp(struct drm_hdcp_helper_data *data,
cbc5065be3a652f Sean Paul 2021-09-15 1128 struct drm_atomic_state *state,
cbc5065be3a652f Sean Paul 2021-09-15 1129 struct mutex *driver_mutex)
cbc5065be3a652f Sean Paul 2021-09-15 1130 {
cbc5065be3a652f Sean Paul 2021-09-15 1131 struct drm_connector *connector = data->connector;
cbc5065be3a652f Sean Paul 2021-09-15 1132 struct drm_connector_state *conn_state;
cbc5065be3a652f Sean Paul 2021-09-15 1133 struct drm_device *dev = connector->dev;
cbc5065be3a652f Sean Paul 2021-09-15 1134 unsigned long check_link_interval;
cbc5065be3a652f Sean Paul 2021-09-15 1135 bool capable;
cbc5065be3a652f Sean Paul 2021-09-15 1136 int ret = 0;
cbc5065be3a652f Sean Paul 2021-09-15 1137
cbc5065be3a652f Sean Paul 2021-09-15 1138 conn_state = drm_atomic_get_new_connector_state(state, connector);
cbc5065be3a652f Sean Paul 2021-09-15 1139
cbc5065be3a652f Sean Paul 2021-09-15 1140 mutex_lock(&data->mutex);
cbc5065be3a652f Sean Paul 2021-09-15 1141
cbc5065be3a652f Sean Paul 2021-09-15 1142 if (data->value == DRM_MODE_CONTENT_PROTECTION_ENABLED) {
cbc5065be3a652f Sean Paul 2021-09-15 1143 drm_hdcp_update_value(data, DRM_MODE_CONTENT_PROTECTION_ENABLED,
cbc5065be3a652f Sean Paul 2021-09-15 1144 true);
cbc5065be3a652f Sean Paul 2021-09-15 1145 goto out_data_mutex;
cbc5065be3a652f Sean Paul 2021-09-15 1146 }
cbc5065be3a652f Sean Paul 2021-09-15 1147
cbc5065be3a652f Sean Paul 2021-09-15 1148 drm_WARN_ON(dev, data->driver_mutex != NULL);
cbc5065be3a652f Sean Paul 2021-09-15 1149 data->driver_mutex = driver_mutex;
cbc5065be3a652f Sean Paul 2021-09-15 1150
cbc5065be3a652f Sean Paul 2021-09-15 1151 drm_hdcp_helper_driver_lock(data);
cbc5065be3a652f Sean Paul 2021-09-15 1152
cbc5065be3a652f Sean Paul 2021-09-15 1153 if (data->funcs->setup) {
cbc5065be3a652f Sean Paul 2021-09-15 1154 ret = data->funcs->setup(connector, state);
cbc5065be3a652f Sean Paul 2021-09-15 1155 if (ret) {
cbc5065be3a652f Sean Paul 2021-09-15 1156 drm_err(dev, "Failed to setup HDCP %d\n", ret);
cbc5065be3a652f Sean Paul 2021-09-15 1157 goto out;
cbc5065be3a652f Sean Paul 2021-09-15 1158 }
cbc5065be3a652f Sean Paul 2021-09-15 1159 }
cbc5065be3a652f Sean Paul 2021-09-15 1160
cbc5065be3a652f Sean Paul 2021-09-15 1161 if (!data->funcs->are_keys_valid ||
cbc5065be3a652f Sean Paul 2021-09-15 1162 !data->funcs->are_keys_valid(connector)) {
cbc5065be3a652f Sean Paul 2021-09-15 1163 if (data->funcs->load_keys) {
cbc5065be3a652f Sean Paul 2021-09-15 1164 ret = data->funcs->load_keys(connector);
cbc5065be3a652f Sean Paul 2021-09-15 1165 if (ret) {
cbc5065be3a652f Sean Paul 2021-09-15 1166 drm_err(dev, "Failed to load HDCP keys %d\n", ret);
cbc5065be3a652f Sean Paul 2021-09-15 1167 goto out;
cbc5065be3a652f Sean Paul 2021-09-15 1168 }
cbc5065be3a652f Sean Paul 2021-09-15 1169 }
cbc5065be3a652f Sean Paul 2021-09-15 1170 }
cbc5065be3a652f Sean Paul 2021-09-15 1171
cbc5065be3a652f Sean Paul 2021-09-15 1172 /*
cbc5065be3a652f Sean Paul 2021-09-15 1173 * Considering that HDCP2.2 is more secure than HDCP1.4, If the setup
cbc5065be3a652f Sean Paul 2021-09-15 1174 * is capable of HDCP2.2, it is preferred to use HDCP2.2.
cbc5065be3a652f Sean Paul 2021-09-15 1175 */
cbc5065be3a652f Sean Paul 2021-09-15 1176 ret = data->funcs->hdcp2_capable(connector, &capable);
cbc5065be3a652f Sean Paul 2021-09-15 1177 if (ret) {
cbc5065be3a652f Sean Paul 2021-09-15 1178 drm_err(dev, "HDCP 2.x capability check failed %d\n", ret);
cbc5065be3a652f Sean Paul 2021-09-15 1179 goto out;
cbc5065be3a652f Sean Paul 2021-09-15 1180 }
cbc5065be3a652f Sean Paul 2021-09-15 1181 if (capable) {
cbc5065be3a652f Sean Paul 2021-09-15 1182 data->enabled_type = DRM_MODE_HDCP_CONTENT_TYPE1;
cbc5065be3a652f Sean Paul 2021-09-15 1183 ret = data->funcs->hdcp2_enable(connector);
cbc5065be3a652f Sean Paul 2021-09-15 1184 if (!ret) {
cbc5065be3a652f Sean Paul 2021-09-15 1185 check_link_interval = DRM_HDCP2_CHECK_PERIOD_MS;
cbc5065be3a652f Sean Paul 2021-09-15 1186 goto out;
cbc5065be3a652f Sean Paul 2021-09-15 1187 }
cbc5065be3a652f Sean Paul 2021-09-15 1188 }
cbc5065be3a652f Sean Paul 2021-09-15 1189
cbc5065be3a652f Sean Paul 2021-09-15 1190 /*
cbc5065be3a652f Sean Paul 2021-09-15 1191 * When HDCP2.2 fails and Content Type is not Type1, HDCP1.4 will
cbc5065be3a652f Sean Paul 2021-09-15 1192 * be attempted.
cbc5065be3a652f Sean Paul 2021-09-15 1193 */
cbc5065be3a652f Sean Paul 2021-09-15 1194 ret = drm_hdcp_helper_hdcp1_capable(data, &capable);
cbc5065be3a652f Sean Paul 2021-09-15 1195 if (ret) {
cbc5065be3a652f Sean Paul 2021-09-15 1196 drm_err(dev, "HDCP 1.x capability check failed %d\n", ret);
cbc5065be3a652f Sean Paul 2021-09-15 1197 goto out;
cbc5065be3a652f Sean Paul 2021-09-15 1198 }
cbc5065be3a652f Sean Paul 2021-09-15 1199 if (capable && conn_state->content_type != DRM_MODE_HDCP_CONTENT_TYPE1) {
cbc5065be3a652f Sean Paul 2021-09-15 1200 data->enabled_type = DRM_MODE_HDCP_CONTENT_TYPE0;
cbc5065be3a652f Sean Paul 2021-09-15 1201 ret = drm_hdcp_helper_hdcp1_enable(data);
cbc5065be3a652f Sean Paul 2021-09-15 1202 if (!ret)
cbc5065be3a652f Sean Paul 2021-09-15 1203 check_link_interval = DRM_HDCP_CHECK_PERIOD_MS;
cbc5065be3a652f Sean Paul 2021-09-15 1204 }
cbc5065be3a652f Sean Paul 2021-09-15 1205
cbc5065be3a652f Sean Paul 2021-09-15 1206 out:
cbc5065be3a652f Sean Paul 2021-09-15 1207 if (!ret) {
cbc5065be3a652f Sean Paul 2021-09-15 @1208 schedule_delayed_work(&data->check_work, check_link_interval);
cbc5065be3a652f Sean Paul 2021-09-15 1209 drm_hdcp_update_value(data, DRM_MODE_CONTENT_PROTECTION_ENABLED,
cbc5065be3a652f Sean Paul 2021-09-15 1210 true);
cbc5065be3a652f Sean Paul 2021-09-15 1211 }
cbc5065be3a652f Sean Paul 2021-09-15 1212
cbc5065be3a652f Sean Paul 2021-09-15 1213 drm_hdcp_helper_driver_unlock(data);
cbc5065be3a652f Sean Paul 2021-09-15 1214 if (ret)
cbc5065be3a652f Sean Paul 2021-09-15 1215 data->driver_mutex = NULL;
cbc5065be3a652f Sean Paul 2021-09-15 1216
cbc5065be3a652f Sean Paul 2021-09-15 1217 out_data_mutex:
cbc5065be3a652f Sean Paul 2021-09-15 1218 mutex_unlock(&data->mutex);
cbc5065be3a652f Sean Paul 2021-09-15 1219 return ret;
cbc5065be3a652f Sean Paul 2021-09-15 1220 }
cbc5065be3a652f Sean Paul 2021-09-15 1221
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months
drivers/spi/spi-geni-qcom.c:467:19: warning: Division by zero [clang-analyzer-core.DivideZero]
by kernel test robot
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
CC: Mark Brown <broonie(a)kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 3ca706c189db861b2ca2019a0901b94050ca49d8
commit: 8db90aa36063f471bea1e65e23185913043852dc Merge tag 'v5.11-rc1' into spi-5.11
date: 9 months ago
:::::: branch date: 10 hours ago
:::::: commit date: 9 months ago
config: riscv-randconfig-c006-20210913 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 261cbe98c38f8c1ee1a482fe76511110e790f58a)
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
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 8db90aa36063f471bea1e65e23185913043852dc
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
^
drivers/mtd/nand/raw/diskonchip.c:1389:9: note: Loop condition is false. Exiting loop
tmpb = ReadDOC_(virtadr, reg) & DOC_TOGGLE_BIT;
^
include/linux/mtd/doc2000.h:103:33: note: expanded from macro 'ReadDOC_'
#define ReadDOC_(adr, reg) readb((void __iomem *)(adr) + (reg))
^
arch/riscv/include/asm/mmio.h:138:30: note: expanded from macro 'readb'
#define readb(c) ({ u8 __v; __io_br(); __v = readb_cpu(c); __io_ar(__v); __v; })
^
arch/riscv/include/asm/mmio.h:133:19: note: expanded from macro '__io_br'
#define __io_br() do {} while (0)
^
drivers/mtd/nand/raw/diskonchip.c:1390:9: note: Loop condition is false. Exiting loop
tmpc = ReadDOC_(virtadr, reg) & DOC_TOGGLE_BIT;
^
include/linux/mtd/doc2000.h:103:33: note: expanded from macro 'ReadDOC_'
#define ReadDOC_(adr, reg) readb((void __iomem *)(adr) + (reg))
^
arch/riscv/include/asm/mmio.h:138:30: note: expanded from macro 'readb'
#define readb(c) ({ u8 __v; __io_br(); __v = readb_cpu(c); __io_ar(__v); __v; })
^
arch/riscv/include/asm/mmio.h:133:19: note: expanded from macro '__io_br'
#define __io_br() do {} while (0)
^
drivers/mtd/nand/raw/diskonchip.c:1391:7: note: Assuming 'tmp' is not equal to 'tmpb'
if ((tmp == tmpb) || (tmp != tmpc)) {
^~~~~~~~~~~
drivers/mtd/nand/raw/diskonchip.c:1391:6: note: Left side of '||' is false
if ((tmp == tmpb) || (tmp != tmpc)) {
^
drivers/mtd/nand/raw/diskonchip.c:1391:24: note: Assuming 'tmp' is equal to 'tmpc'
if ((tmp == tmpb) || (tmp != tmpc)) {
^~~~~~~~~~~
drivers/mtd/nand/raw/diskonchip.c:1391:2: note: Taking false branch
if ((tmp == tmpb) || (tmp != tmpc)) {
^
drivers/mtd/nand/raw/diskonchip.c:1397:2: note: Loop condition is false. Execution continues on line 1432
for (mtd = doclist; mtd; mtd = doc->nextdoc) {
^
drivers/mtd/nand/raw/diskonchip.c:1437:6: note: Assuming 'nand' is non-null
if (!nand) {
^~~~~
drivers/mtd/nand/raw/diskonchip.c:1437:2: note: Taking false branch
if (!nand) {
^
drivers/mtd/nand/raw/diskonchip.c:1453:6: note: Assuming field 'rs_decoder' is non-null
if (!doc->rs_decoder) {
^~~~~~~~~~~~~~~~
drivers/mtd/nand/raw/diskonchip.c:1453:2: note: Taking false branch
if (!doc->rs_decoder) {
^
drivers/mtd/nand/raw/diskonchip.c:1460:6: note: 'ChipID' is not equal to DOC_ChipID_DocMilPlus16
if (ChipID == DOC_ChipID_DocMilPlus16)
^~~~~~
drivers/mtd/nand/raw/diskonchip.c:1460:2: note: Taking false branch
if (ChipID == DOC_ChipID_DocMilPlus16)
^
drivers/mtd/nand/raw/diskonchip.c:1487:6: note: 'ChipID' is equal to DOC_ChipID_Doc2k
if (ChipID == DOC_ChipID_Doc2k)
^~~~~~
drivers/mtd/nand/raw/diskonchip.c:1487:2: note: Taking true branch
if (ChipID == DOC_ChipID_Doc2k)
^
drivers/mtd/nand/raw/diskonchip.c:1488:14: note: Calling 'doc2000_init'
numchips = doc2000_init(mtd);
^~~~~~~~~~~~~~~~~
drivers/mtd/nand/raw/diskonchip.c:1227:2: note: Calling 'doc2000_count_chips'
doc2000_count_chips(mtd);
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/mtd/nand/raw/diskonchip.c:404:10: note: Calling 'doc200x_ident_chip'
mfrid = doc200x_ident_chip(mtd, 0);
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/mtd/nand/raw/diskonchip.c:369:2: note: Calling 'doc200x_readid'
doc200x_readid(this, nr, id);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/mtd/nand/raw/diskonchip.c:356:7: note: 'id' is non-null
if (!id)
^~
drivers/mtd/nand/raw/diskonchip.c:356:2: note: Taking false branch
if (!id)
^
drivers/mtd/nand/raw/diskonchip.c:360:1: note: Returning without writing to '*id'
}
^
drivers/mtd/nand/raw/diskonchip.c:369:2: note: Returning from 'doc200x_readid'
doc200x_readid(this, nr, id);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/mtd/nand/raw/diskonchip.c:371:20: note: The left operand of '<<' is a garbage value
ret = ((u16)id[0] << 8) | id[1];
~~~~~ ^
drivers/mtd/nand/raw/diskonchip.c:896:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
ret = mtd_read(mtd, offs, mtd->writesize, &retlen, buf);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/mtd/nand/raw/diskonchip.c:896:2: note: Value stored to 'ret' is never read
ret = mtd_read(mtd, offs, mtd->writesize, &retlen, buf);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings generated.
>> drivers/spi/spi-geni-qcom.c:467:19: warning: Division by zero [clang-analyzer-core.DivideZero]
for (i = 0; i < DIV_ROUND_UP(rx_bytes, bytes_per_fifo_word); i++)
^
include/linux/math.h:36:22: note: expanded from macro 'DIV_ROUND_UP'
#define DIV_ROUND_UP __KERNEL_DIV_ROUND_UP
^
include/uapi/linux/const.h:34:54: note: expanded from macro '__KERNEL_DIV_ROUND_UP'
#define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
^
drivers/spi/spi-geni-qcom.c:589:10: note: Loop condition is false. Exiting loop
m_irq = readl(se->base + SE_GENI_M_IRQ_STATUS);
^
arch/riscv/include/asm/mmio.h:140:30: note: expanded from macro 'readl'
#define readl(c) ({ u32 __v; __io_br(); __v = readl_cpu(c); __io_ar(__v); __v; })
^
arch/riscv/include/asm/mmio.h:133:19: note: expanded from macro '__io_br'
#define __io_br() do {} while (0)
^
drivers/spi/spi-geni-qcom.c:590:6: note: Assuming 'm_irq' is not equal to 0
if (!m_irq)
^~~~~~
drivers/spi/spi-geni-qcom.c:590:2: note: Taking false branch
if (!m_irq)
^
drivers/spi/spi-geni-qcom.c:593:6: note: Assuming the condition is false
if (m_irq & (M_CMD_OVERRUN_EN | M_ILLEGAL_CMD_EN | M_CMD_FAILURE_EN |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi-geni-qcom.c:593:2: note: Taking false branch
if (m_irq & (M_CMD_OVERRUN_EN | M_ILLEGAL_CMD_EN | M_CMD_FAILURE_EN |
^
drivers/spi/spi-geni-qcom.c:600:7: note: Assuming the condition is false
if ((m_irq & M_RX_FIFO_WATERMARK_EN) || (m_irq & M_RX_FIFO_LAST_EN))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi-geni-qcom.c:600:6: note: Left side of '||' is false
if ((m_irq & M_RX_FIFO_WATERMARK_EN) || (m_irq & M_RX_FIFO_LAST_EN))
^
drivers/spi/spi-geni-qcom.c:600:43: note: Assuming the condition is true
if ((m_irq & M_RX_FIFO_WATERMARK_EN) || (m_irq & M_RX_FIFO_LAST_EN))
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi-geni-qcom.c:600:2: note: Taking true branch
if ((m_irq & M_RX_FIFO_WATERMARK_EN) || (m_irq & M_RX_FIFO_LAST_EN))
^
drivers/spi/spi-geni-qcom.c:601:3: note: Calling 'geni_spi_handle_rx'
geni_spi_handle_rx(mas);
^~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi-geni-qcom.c:453:37: note: Calling 'geni_byte_per_fifo_word'
unsigned int bytes_per_fifo_word = geni_byte_per_fifo_word(mas);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi-geni-qcom.c:401:6: note: Assuming the condition is true
if (mas->fifo_width_bits % mas->cur_bits_per_word)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi-geni-qcom.c:401:2: note: Taking true branch
if (mas->fifo_width_bits % mas->cur_bits_per_word)
^
drivers/spi/spi-geni-qcom.c:402:10: note: '?' condition is false
return roundup_pow_of_two(DIV_ROUND_UP(mas->cur_bits_per_word,
^
include/linux/log2.h:176:2: note: expanded from macro 'roundup_pow_of_two'
__builtin_constant_p(n) ? ( \
^
drivers/spi/spi-geni-qcom.c:402:10: note: Calling '__roundup_pow_of_two'
return roundup_pow_of_two(DIV_ROUND_UP(mas->cur_bits_per_word,
^
include/linux/log2.h:180:2: note: expanded from macro 'roundup_pow_of_two'
__roundup_pow_of_two(n) \
^~~~~~~~~~~~~~~~~~~~~~~
include/linux/log2.h:57:2: note: Returning the value 9223372036854775808
return 1UL << fls_long(n - 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi-geni-qcom.c:402:10: note: Returning from '__roundup_pow_of_two'
return roundup_pow_of_two(DIV_ROUND_UP(mas->cur_bits_per_word,
^
include/linux/log2.h:180:2: note: expanded from macro 'roundup_pow_of_two'
__roundup_pow_of_two(n) \
^~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi-geni-qcom.c:402:3: note: Returning without writing to 'mas->cur_xfer', which participates in a condition later
return roundup_pow_of_two(DIV_ROUND_UP(mas->cur_bits_per_word,
^
drivers/spi/spi-geni-qcom.c:402:3: note: Returning zero
return roundup_pow_of_two(DIV_ROUND_UP(mas->cur_bits_per_word,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi-geni-qcom.c:453:37: note: Returning from 'geni_byte_per_fifo_word'
unsigned int bytes_per_fifo_word = geni_byte_per_fifo_word(mas);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi-geni-qcom.c:453:2: note: 'bytes_per_fifo_word' initialized to 0
unsigned int bytes_per_fifo_word = geni_byte_per_fifo_word(mas);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi-geni-qcom.c:456:19: note: Loop condition is false. Exiting loop
rx_fifo_status = readl(se->base + SE_GENI_RX_FIFO_STATUS);
^
arch/riscv/include/asm/mmio.h:140:30: note: expanded from macro 'readl'
#define readl(c) ({ u32 __v; __io_br(); __v = readl_cpu(c); __io_ar(__v); __v; })
^
arch/riscv/include/asm/mmio.h:133:19: note: expanded from macro '__io_br'
#define __io_br() do {} while (0)
^
drivers/spi/spi-geni-qcom.c:458:6: note: Assuming the condition is false
if (rx_fifo_status & RX_LAST) {
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi-geni-qcom.c:458:2: note: Taking false branch
if (rx_fifo_status & RX_LAST) {
vim +467 drivers/spi/spi-geni-qcom.c
6d66507d9b5507 Douglas Anderson 2020-09-12 445
6d66507d9b5507 Douglas Anderson 2020-09-12 446 static void geni_spi_handle_rx(struct spi_geni_master *mas)
6d66507d9b5507 Douglas Anderson 2020-09-12 447 {
6d66507d9b5507 Douglas Anderson 2020-09-12 448 struct geni_se *se = &mas->se;
6d66507d9b5507 Douglas Anderson 2020-09-12 449 u32 rx_fifo_status;
6d66507d9b5507 Douglas Anderson 2020-09-12 450 unsigned int rx_bytes;
6d66507d9b5507 Douglas Anderson 2020-09-12 451 unsigned int rx_last_byte_valid;
6d66507d9b5507 Douglas Anderson 2020-09-12 452 u8 *rx_buf;
6d66507d9b5507 Douglas Anderson 2020-09-12 453 unsigned int bytes_per_fifo_word = geni_byte_per_fifo_word(mas);
6d66507d9b5507 Douglas Anderson 2020-09-12 454 unsigned int i = 0;
6d66507d9b5507 Douglas Anderson 2020-09-12 455
6d66507d9b5507 Douglas Anderson 2020-09-12 456 rx_fifo_status = readl(se->base + SE_GENI_RX_FIFO_STATUS);
6d66507d9b5507 Douglas Anderson 2020-09-12 457 rx_bytes = (rx_fifo_status & RX_FIFO_WC_MSK) * bytes_per_fifo_word;
6d66507d9b5507 Douglas Anderson 2020-09-12 458 if (rx_fifo_status & RX_LAST) {
6d66507d9b5507 Douglas Anderson 2020-09-12 459 rx_last_byte_valid = rx_fifo_status & RX_LAST_BYTE_VALID_MSK;
6d66507d9b5507 Douglas Anderson 2020-09-12 460 rx_last_byte_valid >>= RX_LAST_BYTE_VALID_SHFT;
6d66507d9b5507 Douglas Anderson 2020-09-12 461 if (rx_last_byte_valid && rx_last_byte_valid < 4)
6d66507d9b5507 Douglas Anderson 2020-09-12 462 rx_bytes -= bytes_per_fifo_word - rx_last_byte_valid;
6d66507d9b5507 Douglas Anderson 2020-09-12 463 }
4aa1464acbe369 Douglas Anderson 2020-12-17 464
4aa1464acbe369 Douglas Anderson 2020-12-17 465 /* Clear out the FIFO and bail if nowhere to put it */
4aa1464acbe369 Douglas Anderson 2020-12-17 466 if (!mas->cur_xfer) {
4aa1464acbe369 Douglas Anderson 2020-12-17 @467 for (i = 0; i < DIV_ROUND_UP(rx_bytes, bytes_per_fifo_word); i++)
4aa1464acbe369 Douglas Anderson 2020-12-17 468 readl(se->base + SE_GENI_RX_FIFOn);
4aa1464acbe369 Douglas Anderson 2020-12-17 469 return;
4aa1464acbe369 Douglas Anderson 2020-12-17 470 }
4aa1464acbe369 Douglas Anderson 2020-12-17 471
6d66507d9b5507 Douglas Anderson 2020-09-12 472 if (mas->rx_rem_bytes < rx_bytes)
6d66507d9b5507 Douglas Anderson 2020-09-12 473 rx_bytes = mas->rx_rem_bytes;
6d66507d9b5507 Douglas Anderson 2020-09-12 474
6d66507d9b5507 Douglas Anderson 2020-09-12 475 rx_buf = mas->cur_xfer->rx_buf + mas->cur_xfer->len - mas->rx_rem_bytes;
6d66507d9b5507 Douglas Anderson 2020-09-12 476 while (i < rx_bytes) {
6d66507d9b5507 Douglas Anderson 2020-09-12 477 u32 fifo_word = 0;
6d66507d9b5507 Douglas Anderson 2020-09-12 478 u8 *fifo_byte = (u8 *)&fifo_word;
6d66507d9b5507 Douglas Anderson 2020-09-12 479 unsigned int bytes_to_read;
6d66507d9b5507 Douglas Anderson 2020-09-12 480 unsigned int j;
6d66507d9b5507 Douglas Anderson 2020-09-12 481
6d66507d9b5507 Douglas Anderson 2020-09-12 482 bytes_to_read = min(bytes_per_fifo_word, rx_bytes - i);
6d66507d9b5507 Douglas Anderson 2020-09-12 483 ioread32_rep(se->base + SE_GENI_RX_FIFOn, &fifo_word, 1);
6d66507d9b5507 Douglas Anderson 2020-09-12 484 for (j = 0; j < bytes_to_read; j++)
6d66507d9b5507 Douglas Anderson 2020-09-12 485 rx_buf[i++] = fifo_byte[j];
6d66507d9b5507 Douglas Anderson 2020-09-12 486 }
6d66507d9b5507 Douglas Anderson 2020-09-12 487 mas->rx_rem_bytes -= rx_bytes;
6d66507d9b5507 Douglas Anderson 2020-09-12 488 }
6d66507d9b5507 Douglas Anderson 2020-09-12 489
:::::: The code at line 467 was first introduced by commit
:::::: 4aa1464acbe3697710279a4bd65cb4801ed30425 spi: spi-geni-qcom: Fix geni_spi_isr() NULL dereference in timeout case
:::::: TO: Douglas Anderson <dianders(a)chromium.org>
:::::: CC: Mark Brown <broonie(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months, 1 week
[jgunthorpe:vfio_ccw 7/12] drivers/vfio/mdev/mdev_core.c:319 mdev_device_create() warn: variable dereferenced before check 'drv' (see line 272)
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Jason Gunthorpe <jgg(a)nvidia.com>
tree: https://github.com/jgunthorpe/linux vfio_ccw
head: d0d01fdc87368c19ee6cac8e7ab2c0ef7ab33efb
commit: c7863bcc74538df3d39bd9407ae77f6ef778f7b3 [7/12] vfio/mdev: Add mdev available instance checking to the core
:::::: branch date: 13 hours ago
:::::: commit date: 31 hours ago
config: x86_64-randconfig-m001-20210914 (attached as .config)
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>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/vfio/mdev/mdev_core.c:319 mdev_device_create() warn: variable dereferenced before check 'drv' (see line 272)
vim +/drv +319 drivers/vfio/mdev/mdev_core.c
7b96953bc640b6 Kirti Wankhede 2016-11-17 254
417fd5bf242d76 Jason Gunthorpe 2021-04-06 255 int mdev_device_create(struct mdev_type *type, const guid_t *uuid)
7b96953bc640b6 Kirti Wankhede 2016-11-17 256 {
7b96953bc640b6 Kirti Wankhede 2016-11-17 257 int ret;
002fe996f67f4f Alex Williamson 2018-05-15 258 struct mdev_device *mdev, *tmp;
a9f8111d0b5f44 Jason Gunthorpe 2021-04-06 259 struct mdev_parent *parent = type->parent;
88a21f265ce50a Jason Gunthorpe 2021-06-17 260 struct mdev_driver *drv = parent->ops->device_driver;
7b96953bc640b6 Kirti Wankhede 2016-11-17 261
002fe996f67f4f Alex Williamson 2018-05-15 262 mutex_lock(&mdev_list_lock);
7b96953bc640b6 Kirti Wankhede 2016-11-17 263
7b96953bc640b6 Kirti Wankhede 2016-11-17 264 /* Check for duplicate */
002fe996f67f4f Alex Williamson 2018-05-15 265 list_for_each_entry(tmp, &mdev_list, next) {
278bca7f318e6a Andy Shevchenko 2019-01-10 266 if (guid_equal(&tmp->uuid, uuid)) {
002fe996f67f4f Alex Williamson 2018-05-15 267 mutex_unlock(&mdev_list_lock);
fbd0e2b0c3d0b2 Jason Gunthorpe 2021-04-06 268 return -EEXIST;
002fe996f67f4f Alex Williamson 2018-05-15 269 }
7b96953bc640b6 Kirti Wankhede 2016-11-17 270 }
7b96953bc640b6 Kirti Wankhede 2016-11-17 271
c7863bcc74538d Jason Gunthorpe 2021-09-07 @272 if (drv->get_available) {
c7863bcc74538d Jason Gunthorpe 2021-09-07 273 if (!type->available) {
c7863bcc74538d Jason Gunthorpe 2021-09-07 274 mutex_unlock(&mdev_list_lock);
c7863bcc74538d Jason Gunthorpe 2021-09-07 275 return -EUSERS;
c7863bcc74538d Jason Gunthorpe 2021-09-07 276 }
c7863bcc74538d Jason Gunthorpe 2021-09-07 277 type->available--;
c7863bcc74538d Jason Gunthorpe 2021-09-07 278 }
c7863bcc74538d Jason Gunthorpe 2021-09-07 279
7b96953bc640b6 Kirti Wankhede 2016-11-17 280 mdev = kzalloc(sizeof(*mdev), GFP_KERNEL);
7b96953bc640b6 Kirti Wankhede 2016-11-17 281 if (!mdev) {
002fe996f67f4f Alex Williamson 2018-05-15 282 mutex_unlock(&mdev_list_lock);
fbd0e2b0c3d0b2 Jason Gunthorpe 2021-04-06 283 return -ENOMEM;
7b96953bc640b6 Kirti Wankhede 2016-11-17 284 }
7b96953bc640b6 Kirti Wankhede 2016-11-17 285
fbd0e2b0c3d0b2 Jason Gunthorpe 2021-04-06 286 device_initialize(&mdev->dev);
fbd0e2b0c3d0b2 Jason Gunthorpe 2021-04-06 287 mdev->dev.parent = parent->dev;
fbd0e2b0c3d0b2 Jason Gunthorpe 2021-04-06 288 mdev->dev.bus = &mdev_bus_type;
fbd0e2b0c3d0b2 Jason Gunthorpe 2021-04-06 289 mdev->dev.release = mdev_device_release;
fbd0e2b0c3d0b2 Jason Gunthorpe 2021-04-06 290 mdev->dev.groups = parent->ops->mdev_attr_groups;
fbd0e2b0c3d0b2 Jason Gunthorpe 2021-04-06 291 mdev->type = type;
fbd0e2b0c3d0b2 Jason Gunthorpe 2021-04-06 292 /* Pairs with the put in mdev_device_release() */
fbea43239074e1 Jason Gunthorpe 2021-04-06 293 kobject_get(&type->kobj);
fbd0e2b0c3d0b2 Jason Gunthorpe 2021-04-06 294
278bca7f318e6a Andy Shevchenko 2019-01-10 295 guid_copy(&mdev->uuid, uuid);
002fe996f67f4f Alex Williamson 2018-05-15 296 list_add(&mdev->next, &mdev_list);
002fe996f67f4f Alex Williamson 2018-05-15 297 mutex_unlock(&mdev_list_lock);
002fe996f67f4f Alex Williamson 2018-05-15 298
18d731242d5c67 Jason Gunthorpe 2021-04-06 299 ret = dev_set_name(&mdev->dev, "%pUl", uuid);
18d731242d5c67 Jason Gunthorpe 2021-04-06 300 if (ret)
18d731242d5c67 Jason Gunthorpe 2021-04-06 301 goto out_put_device;
7b96953bc640b6 Kirti Wankhede 2016-11-17 302
5715c4dd66a315 Parav Pandit 2019-06-06 303 /* Check if parent unregistration has started */
5715c4dd66a315 Parav Pandit 2019-06-06 304 if (!down_read_trylock(&parent->unreg_sem)) {
5715c4dd66a315 Parav Pandit 2019-06-06 305 ret = -ENODEV;
fbd0e2b0c3d0b2 Jason Gunthorpe 2021-04-06 306 goto out_put_device;
5715c4dd66a315 Parav Pandit 2019-06-06 307 }
5715c4dd66a315 Parav Pandit 2019-06-06 308
88a21f265ce50a Jason Gunthorpe 2021-06-17 309 if (parent->ops->create) {
c2ef2f50ad0ccf Jason Gunthorpe 2021-04-06 310 ret = parent->ops->create(mdev);
522ecce08ab20b Parav Pandit 2019-06-06 311 if (ret)
fbd0e2b0c3d0b2 Jason Gunthorpe 2021-04-06 312 goto out_unlock;
88a21f265ce50a Jason Gunthorpe 2021-06-17 313 }
7b96953bc640b6 Kirti Wankhede 2016-11-17 314
522ecce08ab20b Parav Pandit 2019-06-06 315 ret = device_add(&mdev->dev);
7b96953bc640b6 Kirti Wankhede 2016-11-17 316 if (ret)
fbd0e2b0c3d0b2 Jason Gunthorpe 2021-04-06 317 goto out_remove;
7b96953bc640b6 Kirti Wankhede 2016-11-17 318
88a21f265ce50a Jason Gunthorpe 2021-06-17 @319 if (!drv)
88a21f265ce50a Jason Gunthorpe 2021-06-17 320 drv = &vfio_mdev_driver;
88a21f265ce50a Jason Gunthorpe 2021-06-17 321 ret = device_driver_attach(&drv->driver, &mdev->dev);
88a21f265ce50a Jason Gunthorpe 2021-06-17 322 if (ret)
88a21f265ce50a Jason Gunthorpe 2021-06-17 323 goto out_del;
88a21f265ce50a Jason Gunthorpe 2021-06-17 324
417fd5bf242d76 Jason Gunthorpe 2021-04-06 325 ret = mdev_create_sysfs_files(mdev);
522ecce08ab20b Parav Pandit 2019-06-06 326 if (ret)
fbd0e2b0c3d0b2 Jason Gunthorpe 2021-04-06 327 goto out_del;
7b96953bc640b6 Kirti Wankhede 2016-11-17 328
002fe996f67f4f Alex Williamson 2018-05-15 329 mdev->active = true;
7b96953bc640b6 Kirti Wankhede 2016-11-17 330 dev_dbg(&mdev->dev, "MDEV: created\n");
5715c4dd66a315 Parav Pandit 2019-06-06 331 up_read(&parent->unreg_sem);
7b96953bc640b6 Kirti Wankhede 2016-11-17 332
002fe996f67f4f Alex Williamson 2018-05-15 333 return 0;
7b96953bc640b6 Kirti Wankhede 2016-11-17 334
fbd0e2b0c3d0b2 Jason Gunthorpe 2021-04-06 335 out_del:
522ecce08ab20b Parav Pandit 2019-06-06 336 device_del(&mdev->dev);
fbd0e2b0c3d0b2 Jason Gunthorpe 2021-04-06 337 out_remove:
88a21f265ce50a Jason Gunthorpe 2021-06-17 338 if (parent->ops->remove)
522ecce08ab20b Parav Pandit 2019-06-06 339 parent->ops->remove(mdev);
fbd0e2b0c3d0b2 Jason Gunthorpe 2021-04-06 340 out_unlock:
5715c4dd66a315 Parav Pandit 2019-06-06 341 up_read(&parent->unreg_sem);
fbd0e2b0c3d0b2 Jason Gunthorpe 2021-04-06 342 out_put_device:
522ecce08ab20b Parav Pandit 2019-06-06 343 put_device(&mdev->dev);
7b96953bc640b6 Kirti Wankhede 2016-11-17 344 return ret;
7b96953bc640b6 Kirti Wankhede 2016-11-17 345 }
7b96953bc640b6 Kirti Wankhede 2016-11-17 346
:::::: The code at line 319 was first introduced by commit
:::::: 88a21f265ce50a17e6e71e3fb4467625cf234c5a vfio/mdev: Allow the mdev_parent_ops to specify the device driver to bind
:::::: TO: Jason Gunthorpe <jgg(a)nvidia.com>
:::::: CC: Alex Williamson <alex.williamson(a)redhat.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months, 1 week
[hch-block:blkdev.h-includes 2/17] drivers/md/dm-ima.c:54:29: error: implicit declaration of function 'memalloc_noio_save'
by kernel test robot
CC: kbuild-all(a)lists.01.org
TO: Christoph Hellwig <hch(a)lst.de>
tree: git://git.infradead.org/users/hch/block.git blkdev.h-includes
head: 0687088056048288700f442e86ea92af0fce9a12
commit: b7260dd875e13760df5d1a677c85a1062b49128a [2/17] mm: don't include <linux/blk-cgroup.h> in <linux/backing-dev.h>
:::::: branch date: 24 hours ago
:::::: commit date: 24 hours ago
config: arc-randconfig-c023-20210913 (attached as .config)
compiler: arceb-elf-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
git remote add hch-block git://git.infradead.org/users/hch/block.git
git fetch --no-tags hch-block blkdev.h-includes
git checkout b7260dd875e13760df5d1a677c85a1062b49128a
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=arc
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/md/dm-ima.c: In function 'dm_ima_alloc':
>> drivers/md/dm-ima.c:54:29: error: implicit declaration of function 'memalloc_noio_save' [-Werror=implicit-function-declaration]
54 | noio_flag = memalloc_noio_save();
| ^~~~~~~~~~~~~~~~~~
>> drivers/md/dm-ima.c:59:17: error: implicit declaration of function 'memalloc_noio_restore' [-Werror=implicit-function-declaration]
59 | memalloc_noio_restore(noio_flag);
| ^~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/memalloc_noio_save +54 drivers/md/dm-ima.c
91ccbbac1747ee Tushar Sugandhi 2021-07-12 44
91ccbbac1747ee Tushar Sugandhi 2021-07-12 45 /*
91ccbbac1747ee Tushar Sugandhi 2021-07-12 46 * Internal function to allocate memory for IMA measurements.
91ccbbac1747ee Tushar Sugandhi 2021-07-12 47 */
91ccbbac1747ee Tushar Sugandhi 2021-07-12 48 static void *dm_ima_alloc(size_t len, gfp_t flags, bool noio)
91ccbbac1747ee Tushar Sugandhi 2021-07-12 49 {
91ccbbac1747ee Tushar Sugandhi 2021-07-12 50 unsigned int noio_flag;
91ccbbac1747ee Tushar Sugandhi 2021-07-12 51 void *ptr;
91ccbbac1747ee Tushar Sugandhi 2021-07-12 52
91ccbbac1747ee Tushar Sugandhi 2021-07-12 53 if (noio)
91ccbbac1747ee Tushar Sugandhi 2021-07-12 @54 noio_flag = memalloc_noio_save();
91ccbbac1747ee Tushar Sugandhi 2021-07-12 55
91ccbbac1747ee Tushar Sugandhi 2021-07-12 56 ptr = kzalloc(len, flags);
91ccbbac1747ee Tushar Sugandhi 2021-07-12 57
91ccbbac1747ee Tushar Sugandhi 2021-07-12 58 if (noio)
91ccbbac1747ee Tushar Sugandhi 2021-07-12 @59 memalloc_noio_restore(noio_flag);
91ccbbac1747ee Tushar Sugandhi 2021-07-12 60
91ccbbac1747ee Tushar Sugandhi 2021-07-12 61 return ptr;
91ccbbac1747ee Tushar Sugandhi 2021-07-12 62 }
91ccbbac1747ee Tushar Sugandhi 2021-07-12 63
:::::: The code at line 54 was first introduced by commit
:::::: 91ccbbac1747eea155632a1c6bb100052309b215 dm ima: measure data on table load
:::::: TO: Tushar Sugandhi <tusharsu(a)linux.microsoft.com>
:::::: CC: Mike Snitzer <snitzer(a)redhat.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months, 1 week
[djwong-xfs:zero-initialize-pmem 397/453] fs/xfs/xfs_reflink.c:169 xfs_reflink_find_shared() warn: variable dereferenced before check 'agbp' (see line 161)
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: "Darrick J. Wong" <darrick.wong(a)oracle.com>
CC: linux-kernel(a)vger.kernel.org
TO: "Darrick J. Wong" <djwong(a)kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git zero-initialize-pmem
head: 5d7c810c2c92826f9bceb9c3a1ca6b9e41ff7a99
commit: 079d17f46f6be6c61da351b0b132e02202bd268d [397/453] xfs: wire up realtime refcount btree cursors
:::::: branch date: 22 hours ago
:::::: commit date: 22 hours ago
config: i386-randconfig-m021-20210912 (attached as .config)
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>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
fs/xfs/xfs_reflink.c:169 xfs_reflink_find_shared() warn: variable dereferenced before check 'agbp' (see line 161)
Old smatch warnings:
fs/xfs/xfs_reflink.c:652 xfs_reflink_end_cow_extent() warn: missing error code 'error'
vim +/agbp +169 fs/xfs/xfs_reflink.c
3993baeb3c52f4 Darrick J. Wong 2016-10-03 34
3993baeb3c52f4 Darrick J. Wong 2016-10-03 35 /*
3993baeb3c52f4 Darrick J. Wong 2016-10-03 36 * Copy on Write of Shared Blocks
3993baeb3c52f4 Darrick J. Wong 2016-10-03 37 *
3993baeb3c52f4 Darrick J. Wong 2016-10-03 38 * XFS must preserve "the usual" file semantics even when two files share
3993baeb3c52f4 Darrick J. Wong 2016-10-03 39 * the same physical blocks. This means that a write to one file must not
3993baeb3c52f4 Darrick J. Wong 2016-10-03 40 * alter the blocks in a different file; the way that we'll do that is
3993baeb3c52f4 Darrick J. Wong 2016-10-03 41 * through the use of a copy-on-write mechanism. At a high level, that
3993baeb3c52f4 Darrick J. Wong 2016-10-03 42 * means that when we want to write to a shared block, we allocate a new
3993baeb3c52f4 Darrick J. Wong 2016-10-03 43 * block, write the data to the new block, and if that succeeds we map the
3993baeb3c52f4 Darrick J. Wong 2016-10-03 44 * new block into the file.
3993baeb3c52f4 Darrick J. Wong 2016-10-03 45 *
3993baeb3c52f4 Darrick J. Wong 2016-10-03 46 * XFS provides a "delayed allocation" mechanism that defers the allocation
3993baeb3c52f4 Darrick J. Wong 2016-10-03 47 * of disk blocks to dirty-but-not-yet-mapped file blocks as long as
3993baeb3c52f4 Darrick J. Wong 2016-10-03 48 * possible. This reduces fragmentation by enabling the filesystem to ask
3993baeb3c52f4 Darrick J. Wong 2016-10-03 49 * for bigger chunks less often, which is exactly what we want for CoW.
3993baeb3c52f4 Darrick J. Wong 2016-10-03 50 *
3993baeb3c52f4 Darrick J. Wong 2016-10-03 51 * The delalloc mechanism begins when the kernel wants to make a block
3993baeb3c52f4 Darrick J. Wong 2016-10-03 52 * writable (write_begin or page_mkwrite). If the offset is not mapped, we
3993baeb3c52f4 Darrick J. Wong 2016-10-03 53 * create a delalloc mapping, which is a regular in-core extent, but without
3993baeb3c52f4 Darrick J. Wong 2016-10-03 54 * a real startblock. (For delalloc mappings, the startblock encodes both
3993baeb3c52f4 Darrick J. Wong 2016-10-03 55 * a flag that this is a delalloc mapping, and a worst-case estimate of how
3993baeb3c52f4 Darrick J. Wong 2016-10-03 56 * many blocks might be required to put the mapping into the BMBT.) delalloc
3993baeb3c52f4 Darrick J. Wong 2016-10-03 57 * mappings are a reservation against the free space in the filesystem;
3993baeb3c52f4 Darrick J. Wong 2016-10-03 58 * adjacent mappings can also be combined into fewer larger mappings.
3993baeb3c52f4 Darrick J. Wong 2016-10-03 59 *
5eda43000064a6 Darrick J. Wong 2017-02-02 60 * As an optimization, the CoW extent size hint (cowextsz) creates
5eda43000064a6 Darrick J. Wong 2017-02-02 61 * outsized aligned delalloc reservations in the hope of landing out of
5eda43000064a6 Darrick J. Wong 2017-02-02 62 * order nearby CoW writes in a single extent on disk, thereby reducing
5eda43000064a6 Darrick J. Wong 2017-02-02 63 * fragmentation and improving future performance.
5eda43000064a6 Darrick J. Wong 2017-02-02 64 *
5eda43000064a6 Darrick J. Wong 2017-02-02 65 * D: --RRRRRRSSSRRRRRRRR--- (data fork)
5eda43000064a6 Darrick J. Wong 2017-02-02 66 * C: ------DDDDDDD--------- (CoW fork)
5eda43000064a6 Darrick J. Wong 2017-02-02 67 *
3993baeb3c52f4 Darrick J. Wong 2016-10-03 68 * When dirty pages are being written out (typically in writepage), the
5eda43000064a6 Darrick J. Wong 2017-02-02 69 * delalloc reservations are converted into unwritten mappings by
5eda43000064a6 Darrick J. Wong 2017-02-02 70 * allocating blocks and replacing the delalloc mapping with real ones.
5eda43000064a6 Darrick J. Wong 2017-02-02 71 * A delalloc mapping can be replaced by several unwritten ones if the
5eda43000064a6 Darrick J. Wong 2017-02-02 72 * free space is fragmented.
5eda43000064a6 Darrick J. Wong 2017-02-02 73 *
5eda43000064a6 Darrick J. Wong 2017-02-02 74 * D: --RRRRRRSSSRRRRRRRR---
5eda43000064a6 Darrick J. Wong 2017-02-02 75 * C: ------UUUUUUU---------
3993baeb3c52f4 Darrick J. Wong 2016-10-03 76 *
3993baeb3c52f4 Darrick J. Wong 2016-10-03 77 * We want to adapt the delalloc mechanism for copy-on-write, since the
3993baeb3c52f4 Darrick J. Wong 2016-10-03 78 * write paths are similar. The first two steps (creating the reservation
3993baeb3c52f4 Darrick J. Wong 2016-10-03 79 * and allocating the blocks) are exactly the same as delalloc except that
3993baeb3c52f4 Darrick J. Wong 2016-10-03 80 * the mappings must be stored in a separate CoW fork because we do not want
3993baeb3c52f4 Darrick J. Wong 2016-10-03 81 * to disturb the mapping in the data fork until we're sure that the write
3993baeb3c52f4 Darrick J. Wong 2016-10-03 82 * succeeded. IO completion in this case is the process of removing the old
3993baeb3c52f4 Darrick J. Wong 2016-10-03 83 * mapping from the data fork and moving the new mapping from the CoW fork to
3993baeb3c52f4 Darrick J. Wong 2016-10-03 84 * the data fork. This will be discussed shortly.
3993baeb3c52f4 Darrick J. Wong 2016-10-03 85 *
3993baeb3c52f4 Darrick J. Wong 2016-10-03 86 * For now, unaligned directio writes will be bounced back to the page cache.
3993baeb3c52f4 Darrick J. Wong 2016-10-03 87 * Block-aligned directio writes will use the same mechanism as buffered
3993baeb3c52f4 Darrick J. Wong 2016-10-03 88 * writes.
3993baeb3c52f4 Darrick J. Wong 2016-10-03 89 *
5eda43000064a6 Darrick J. Wong 2017-02-02 90 * Just prior to submitting the actual disk write requests, we convert
5eda43000064a6 Darrick J. Wong 2017-02-02 91 * the extents representing the range of the file actually being written
5eda43000064a6 Darrick J. Wong 2017-02-02 92 * (as opposed to extra pieces created for the cowextsize hint) to real
5eda43000064a6 Darrick J. Wong 2017-02-02 93 * extents. This will become important in the next step:
5eda43000064a6 Darrick J. Wong 2017-02-02 94 *
5eda43000064a6 Darrick J. Wong 2017-02-02 95 * D: --RRRRRRSSSRRRRRRRR---
5eda43000064a6 Darrick J. Wong 2017-02-02 96 * C: ------UUrrUUU---------
5eda43000064a6 Darrick J. Wong 2017-02-02 97 *
3993baeb3c52f4 Darrick J. Wong 2016-10-03 98 * CoW remapping must be done after the data block write completes,
3993baeb3c52f4 Darrick J. Wong 2016-10-03 99 * because we don't want to destroy the old data fork map until we're sure
3993baeb3c52f4 Darrick J. Wong 2016-10-03 100 * the new block has been written. Since the new mappings are kept in a
3993baeb3c52f4 Darrick J. Wong 2016-10-03 101 * separate fork, we can simply iterate these mappings to find the ones
3993baeb3c52f4 Darrick J. Wong 2016-10-03 102 * that cover the file blocks that we just CoW'd. For each extent, simply
3993baeb3c52f4 Darrick J. Wong 2016-10-03 103 * unmap the corresponding range in the data fork, map the new range into
5eda43000064a6 Darrick J. Wong 2017-02-02 104 * the data fork, and remove the extent from the CoW fork. Because of
5eda43000064a6 Darrick J. Wong 2017-02-02 105 * the presence of the cowextsize hint, however, we must be careful
5eda43000064a6 Darrick J. Wong 2017-02-02 106 * only to remap the blocks that we've actually written out -- we must
5eda43000064a6 Darrick J. Wong 2017-02-02 107 * never remap delalloc reservations nor CoW staging blocks that have
5eda43000064a6 Darrick J. Wong 2017-02-02 108 * yet to be written. This corresponds exactly to the real extents in
5eda43000064a6 Darrick J. Wong 2017-02-02 109 * the CoW fork:
5eda43000064a6 Darrick J. Wong 2017-02-02 110 *
5eda43000064a6 Darrick J. Wong 2017-02-02 111 * D: --RRRRRRrrSRRRRRRRR---
5eda43000064a6 Darrick J. Wong 2017-02-02 112 * C: ------UU--UUU---------
3993baeb3c52f4 Darrick J. Wong 2016-10-03 113 *
3993baeb3c52f4 Darrick J. Wong 2016-10-03 114 * Since the remapping operation can be applied to an arbitrary file
3993baeb3c52f4 Darrick J. Wong 2016-10-03 115 * range, we record the need for the remap step as a flag in the ioend
3993baeb3c52f4 Darrick J. Wong 2016-10-03 116 * instead of declaring a new IO type. This is required for direct io
3993baeb3c52f4 Darrick J. Wong 2016-10-03 117 * because we only have ioend for the whole dio, and we have to be able to
3993baeb3c52f4 Darrick J. Wong 2016-10-03 118 * remember the presence of unwritten blocks and CoW blocks with a single
3993baeb3c52f4 Darrick J. Wong 2016-10-03 119 * ioend structure. Better yet, the more ground we can cover with one
3993baeb3c52f4 Darrick J. Wong 2016-10-03 120 * ioend, the better.
3993baeb3c52f4 Darrick J. Wong 2016-10-03 121 */
2a06705cd59540 Darrick J. Wong 2016-10-03 122
2a06705cd59540 Darrick J. Wong 2016-10-03 123 /*
96ce52cfff9a76 Darrick J. Wong 2021-09-01 124 * Given an AG extent, find the lowest-numbered run of shared blocks within
96ce52cfff9a76 Darrick J. Wong 2021-09-01 125 * that range and return the range in fbno/flen. If find_end_of_shared is
96ce52cfff9a76 Darrick J. Wong 2021-09-01 126 * true, return the longest contiguous extent of shared blocks. If there are
96ce52cfff9a76 Darrick J. Wong 2021-09-01 127 * no shared extents, fbno and flen will be set to NULLFSBLOCK and 0,
96ce52cfff9a76 Darrick J. Wong 2021-09-01 128 * respectively.
2a06705cd59540 Darrick J. Wong 2016-10-03 129 */
96ce52cfff9a76 Darrick J. Wong 2021-09-01 130 STATIC int
2a06705cd59540 Darrick J. Wong 2016-10-03 131 xfs_reflink_find_shared(
96ce52cfff9a76 Darrick J. Wong 2021-09-01 132 struct xfs_inode *ip,
92ff7285f1df55 Darrick J. Wong 2017-06-16 133 struct xfs_trans *tp,
96ce52cfff9a76 Darrick J. Wong 2021-09-01 134 struct xfs_bmbt_irec *irec,
96ce52cfff9a76 Darrick J. Wong 2021-09-01 135 xfs_fsblock_t *fbno,
96ce52cfff9a76 Darrick J. Wong 2021-09-01 136 xfs_filblks_t *flen,
2a06705cd59540 Darrick J. Wong 2016-10-03 137 bool find_end_of_shared)
2a06705cd59540 Darrick J. Wong 2016-10-03 138 {
96ce52cfff9a76 Darrick J. Wong 2021-09-01 139 struct xfs_mount *mp = ip->i_mount;
079d17f46f6be6 Darrick J. Wong 2021-09-01 140 struct xfs_buf *agbp = NULL;
2a06705cd59540 Darrick J. Wong 2016-10-03 141 struct xfs_btree_cur *cur;
96ce52cfff9a76 Darrick J. Wong 2021-09-01 142 xfs_agnumber_t agno;
d9906a4068f175 Darrick J. Wong 2021-09-01 143 xfs_fsblock_t agbno;
d9906a4068f175 Darrick J. Wong 2021-09-01 144 xfs_fsblock_t shared_bno;
d9906a4068f175 Darrick J. Wong 2021-09-01 145 xfs_filblks_t shared_len;
2a06705cd59540 Darrick J. Wong 2016-10-03 146 int error;
2a06705cd59540 Darrick J. Wong 2016-10-03 147
079d17f46f6be6 Darrick J. Wong 2021-09-01 148 if (XFS_IS_REALTIME_INODE(ip)) {
079d17f46f6be6 Darrick J. Wong 2021-09-01 149 agno = NULLAGNUMBER;
079d17f46f6be6 Darrick J. Wong 2021-09-01 150 agbno = irec->br_startblock;
079d17f46f6be6 Darrick J. Wong 2021-09-01 151 xfs_rtlock(NULL, mp, XFS_RTLOCK_REFCOUNT);
079d17f46f6be6 Darrick J. Wong 2021-09-01 152 cur = xfs_rtrefcountbt_init_cursor(mp, tp, mp->m_rrefcountip);
079d17f46f6be6 Darrick J. Wong 2021-09-01 153 } else {
96ce52cfff9a76 Darrick J. Wong 2021-09-01 154 agno = XFS_FSB_TO_AGNO(mp, irec->br_startblock);
96ce52cfff9a76 Darrick J. Wong 2021-09-01 155 agbno = XFS_FSB_TO_AGBNO(mp, irec->br_startblock);
96ce52cfff9a76 Darrick J. Wong 2021-09-01 156
92ff7285f1df55 Darrick J. Wong 2017-06-16 157 error = xfs_alloc_read_agf(mp, tp, agno, 0, &agbp);
2a06705cd59540 Darrick J. Wong 2016-10-03 158 if (error)
2a06705cd59540 Darrick J. Wong 2016-10-03 159 return error;
2a06705cd59540 Darrick J. Wong 2016-10-03 160
a81a06211fb43d Dave Chinner 2021-06-02 @161 cur = xfs_refcountbt_init_cursor(mp, tp, agbp, agbp->b_pag);
079d17f46f6be6 Darrick J. Wong 2021-09-01 162 }
2a06705cd59540 Darrick J. Wong 2016-10-03 163
96ce52cfff9a76 Darrick J. Wong 2021-09-01 164 error = xfs_refcount_find_shared(cur, agbno, irec->br_blockcount,
96ce52cfff9a76 Darrick J. Wong 2021-09-01 165 &shared_bno, &shared_len, find_end_of_shared);
2a06705cd59540 Darrick J. Wong 2016-10-03 166
0b04b6b875b32f Darrick J. Wong 2018-07-19 167 xfs_btree_del_cursor(cur, error);
2a06705cd59540 Darrick J. Wong 2016-10-03 168
079d17f46f6be6 Darrick J. Wong 2021-09-01 @169 if (agbp)
92ff7285f1df55 Darrick J. Wong 2017-06-16 170 xfs_trans_brelse(tp, agbp);
079d17f46f6be6 Darrick J. Wong 2021-09-01 171 else
079d17f46f6be6 Darrick J. Wong 2021-09-01 172 xfs_rtunlock(mp, XFS_RTLOCK_REFCOUNT);
96ce52cfff9a76 Darrick J. Wong 2021-09-01 173
d9906a4068f175 Darrick J. Wong 2021-09-01 174 if (shared_bno == NULLFSBLOCK)
96ce52cfff9a76 Darrick J. Wong 2021-09-01 175 *fbno = NULLFSBLOCK;
079d17f46f6be6 Darrick J. Wong 2021-09-01 176 else if (XFS_IS_REALTIME_INODE(ip))
079d17f46f6be6 Darrick J. Wong 2021-09-01 177 *fbno = shared_bno;
96ce52cfff9a76 Darrick J. Wong 2021-09-01 178 else
96ce52cfff9a76 Darrick J. Wong 2021-09-01 179 *fbno = XFS_AGB_TO_FSB(mp, agno, shared_bno);
96ce52cfff9a76 Darrick J. Wong 2021-09-01 180 *flen = shared_len;
2a06705cd59540 Darrick J. Wong 2016-10-03 181 return error;
2a06705cd59540 Darrick J. Wong 2016-10-03 182 }
2a06705cd59540 Darrick J. Wong 2016-10-03 183
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months, 1 week
sound/usb/mixer_scarlett_gen2.c:2429:3: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
by kernel test robot
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: "Geoffrey D. Bennett" <g(a)b4.vu>
CC: Takashi Iwai <tiwai(a)suse.de>
CC: Vladimir Sadovnikov <sadko4u(a)gmail.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 6880fa6c56601bb8ed59df6c30fd390cc5f6dd8f
commit: d5bda7e03982f67ce2f6c0d79b750fb27077331a ALSA: usb-audio: scarlett2: Add support for the talkback feature
date: 3 months ago
:::::: branch date: 11 hours ago
:::::: commit date: 3 months ago
config: i386-randconfig-c001-20210910 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 261cbe98c38f8c1ee1a482fe76511110e790f58a)
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://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout d5bda7e03982f67ce2f6c0d79b750fb27077331a
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
for (i = 0; i < num_mixer_out; i++) {
^
sound/usb/mixer_scarlett_gen2.c:3639:9: note: Calling 'scarlett2_usb_get_mux'
return scarlett2_usb_get_mux(mixer);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/usb/mixer_scarlett_gen2.c:1489:8: note: Calling 'scarlett2_usb'
err = scarlett2_usb(mixer, SCARLETT2_USB_GET_MUX,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/usb/mixer_scarlett_gen2.c:1070:6: note: Assuming 'req' is non-null
if (!req) {
^~~~
sound/usb/mixer_scarlett_gen2.c:1070:2: note: Taking false branch
if (!req) {
^
sound/usb/mixer_scarlett_gen2.c:1076:6: note: Assuming 'resp' is non-null
if (!resp) {
^~~~~
sound/usb/mixer_scarlett_gen2.c:1076:2: note: Taking false branch
if (!resp) {
^
sound/usb/mixer_scarlett_gen2.c:1087:6: note: 'req_size' is 4
if (req_size)
^~~~~~~~
sound/usb/mixer_scarlett_gen2.c:1087:2: note: Taking true branch
if (req_size)
^
sound/usb/mixer_scarlett_gen2.c:1093:6: note: Assuming 'err' is equal to 'req_buf_size'
if (err != req_buf_size) {
^~~~~~~~~~~~~~~~~~~
sound/usb/mixer_scarlett_gen2.c:1093:2: note: Taking false branch
if (err != req_buf_size) {
^
sound/usb/mixer_scarlett_gen2.c:1110:6: note: Assuming 'err' is equal to 'resp_buf_size'
if (err != resp_buf_size) {
^~~~~~~~~~~~~~~~~~~~
sound/usb/mixer_scarlett_gen2.c:1110:2: note: Taking false branch
if (err != resp_buf_size) {
^
sound/usb/mixer_scarlett_gen2.c:1123:6: note: Assuming 'resp->cmd' is equal to 'req->cmd'
if (resp->cmd != req->cmd ||
^~~~~~~~~~~~~~~~~~~~~
sound/usb/mixer_scarlett_gen2.c:1123:6: note: Left side of '||' is false
sound/usb/mixer_scarlett_gen2.c:1124:7: note: Assuming 'resp->seq' is equal to 'req->seq'
(resp->seq != req->seq &&
^~~~~~~~~~~~~~~~~~~~~
sound/usb/mixer_scarlett_gen2.c:1124:29: note: Left side of '&&' is false
(resp->seq != req->seq &&
^
sound/usb/mixer_scarlett_gen2.c:1126:6: note: Assuming 'resp_size' is equal to field 'size'
resp_size != le16_to_cpu(resp->size) ||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/usb/mixer_scarlett_gen2.c:1123:6: note: Left side of '||' is false
if (resp->cmd != req->cmd ||
^
sound/usb/mixer_scarlett_gen2.c:1127:6: note: Assuming field 'error' is 0
resp->error ||
^~~~~~~~~~~
sound/usb/mixer_scarlett_gen2.c:1123:6: note: Left side of '||' is false
if (resp->cmd != req->cmd ||
^
sound/usb/mixer_scarlett_gen2.c:1128:6: note: Assuming field 'pad' is 0
resp->pad) {
^~~~~~~~~
sound/usb/mixer_scarlett_gen2.c:1123:2: note: Taking false branch
if (resp->cmd != req->cmd ||
^
sound/usb/mixer_scarlett_gen2.c:1143:6: note: 'resp_data' is non-null
if (resp_data && resp_size > 0)
^~~~~~~~~
sound/usb/mixer_scarlett_gen2.c:1143:6: note: Left side of '&&' is true
sound/usb/mixer_scarlett_gen2.c:1143:19: note: Assuming 'resp_size' is <= 0
if (resp_data && resp_size > 0)
^~~~~~~~~~~~~
sound/usb/mixer_scarlett_gen2.c:1143:2: note: Taking false branch
if (resp_data && resp_size > 0)
^
sound/usb/mixer_scarlett_gen2.c:1151:2: note: Returning without writing to '*resp_data'
return err;
^
sound/usb/mixer_scarlett_gen2.c:1489:8: note: Returning from 'scarlett2_usb'
err = scarlett2_usb(mixer, SCARLETT2_USB_GET_MUX,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/usb/mixer_scarlett_gen2.c:1492:6: note: Assuming 'err' is >= 0
if (err < 0)
^~~~~~~
sound/usb/mixer_scarlett_gen2.c:1492:2: note: Taking false branch
if (err < 0)
^
sound/usb/mixer_scarlett_gen2.c:1495:7: note: The value 0 is assigned to 'i'
for (i = 0; i < count; i++)
^~~~~
sound/usb/mixer_scarlett_gen2.c:1495:14: note: Assuming 'i' is < 'count'
for (i = 0; i < count; i++)
^~~~~~~~~
sound/usb/mixer_scarlett_gen2.c:1495:2: note: Loop condition is true. Entering loop body
for (i = 0; i < count; i++)
^
sound/usb/mixer_scarlett_gen2.c:1496:3: note: 2nd function call argument is an uninitialized value
scarlett2_usb_populate_mux(private, le32_to_cpu(data[i]));
^
>> sound/usb/mixer_scarlett_gen2.c:2429:3: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
err = scarlett2_usb_get_config(mixer,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/usb/mixer_scarlett_gen2.c:2429:3: note: Value stored to 'err' is never read
err = scarlett2_usb_get_config(mixer,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/usb/mixer_scarlett_gen2.c:2433:38: warning: The left operand of '&' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
private->talkback_map[i] = bitmap & 1;
^
sound/usb/mixer_scarlett_gen2.c:3933:6: note: Assuming field 'protocol' is not equal to 0
if (!mixer->protocol)
^~~~~~~~~~~~~~~~
sound/usb/mixer_scarlett_gen2.c:3933:2: note: Taking false branch
if (!mixer->protocol)
^
sound/usb/mixer_scarlett_gen2.c:3936:6: note: Assuming the condition is false
if (!(chip->setup & SCARLETT2_ENABLE)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/usb/mixer_scarlett_gen2.c:3936:2: note: Taking false branch
if (!(chip->setup & SCARLETT2_ENABLE)) {
^
sound/usb/mixer_scarlett_gen2.c:3951:8: note: Calling 'snd_scarlett_gen2_controls_create'
err = snd_scarlett_gen2_controls_create(mixer);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/usb/mixer_scarlett_gen2.c:3845:9: note: Assuming the condition is true
while (*info && (*info)->usb_id != mixer->chip->usb_id)
^~~~~
sound/usb/mixer_scarlett_gen2.c:3845:9: note: Left side of '&&' is true
sound/usb/mixer_scarlett_gen2.c:3845:18: note: Assuming '(*info)->usb_id' is equal to 'mixer->chip->usb_id'
while (*info && (*info)->usb_id != mixer->chip->usb_id)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/usb/mixer_scarlett_gen2.c:3845:2: note: Loop condition is false. Execution continues on line 3847
while (*info && (*info)->usb_id != mixer->chip->usb_id)
^
sound/usb/mixer_scarlett_gen2.c:3847:2: note: Taking false branch
if (!*info)
^
sound/usb/mixer_scarlett_gen2.c:3852:6: note: 'err' is >= 0
if (err < 0)
^~~
sound/usb/mixer_scarlett_gen2.c:3852:2: note: Taking false branch
if (err < 0)
^
sound/usb/mixer_scarlett_gen2.c:3857:6: note: 'err' is >= 0
if (err < 0)
^~~
sound/usb/mixer_scarlett_gen2.c:3857:2: note: Taking false branch
if (err < 0)
^
sound/usb/mixer_scarlett_gen2.c:3861:8: note: Calling 'scarlett2_read_configs'
err = scarlett2_read_configs(mixer);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/usb/mixer_scarlett_gen2.c:3573:6: note: Assuming field 'has_msd_mode' is 0
if (info->has_msd_mode) {
^~~~~~~~~~~~~~~~~~
sound/usb/mixer_scarlett_gen2.c:3573:2: note: Taking false branch
if (info->has_msd_mode) {
^
sound/usb/mixer_scarlett_gen2.c:3586:6: note: 'err' is >= 0
if (err < 0)
^~~
sound/usb/mixer_scarlett_gen2.c:3586:2: note: Taking false branch
if (err < 0)
^
sound/usb/mixer_scarlett_gen2.c:3589:8: note: Calling 'scarlett2_update_monitor_other'
err = scarlett2_update_monitor_other(mixer);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/usb/mixer_scarlett_gen2.c:2388:6: note: Assuming field 'direct_monitor' is 0
if (info->direct_monitor)
^~~~~~~~~~~~~~~~~~~~
sound/usb/mixer_scarlett_gen2.c:2388:2: note: Taking false branch
if (info->direct_monitor)
^
sound/usb/mixer_scarlett_gen2.c:2396:6: note: Assuming field 'has_speaker_switching' is not equal to 0
if (!info->has_speaker_switching)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/usb/mixer_scarlett_gen2.c:2396:2: note: Taking false branch
if (!info->has_speaker_switching)
^
sound/usb/mixer_scarlett_gen2.c:2402:6: note: 'err' is >= 0
if (err < 0)
^~~
sound/usb/mixer_scarlett_gen2.c:2402:2: note: Taking false branch
if (err < 0)
^
sound/usb/mixer_scarlett_gen2.c:2408:6: note: 'err' is >= 0
if (err < 0)
^~~
sound/usb/mixer_scarlett_gen2.c:2408:2: note: Taking false branch
if (err < 0)
^
sound/usb/mixer_scarlett_gen2.c:2411:6: note: Assuming the condition is true
if (!monitor_other_enable[0])
^~~~~~~~~~~~~~~~~~~~~~~~
sound/usb/mixer_scarlett_gen2.c:2411:2: note: Taking true branch
if (!monitor_other_enable[0])
^
sound/usb/mixer_scarlett_gen2.c:2416:6: note: Assuming field 'has_talkback' is not equal to 0
if (info->has_talkback) {
^~~~~~~~~~~~~~~~~~
sound/usb/mixer_scarlett_gen2.c:2416:2: note: Taking true branch
vim +/err +2429 sound/usb/mixer_scarlett_gen2.c
6ef9fa4a0eb4cd Geoffrey D. Bennett 2021-06-23 2369
6ef9fa4a0eb4cd Geoffrey D. Bennett 2021-06-23 2370 static int scarlett2_update_monitor_other(struct usb_mixer_interface *mixer)
6ef9fa4a0eb4cd Geoffrey D. Bennett 2021-06-23 2371 {
6ef9fa4a0eb4cd Geoffrey D. Bennett 2021-06-23 2372 struct scarlett2_data *private = mixer->private_data;
6ef9fa4a0eb4cd Geoffrey D. Bennett 2021-06-23 2373 const struct scarlett2_device_info *info = private->info;
e914d8432cb4b9 Geoffrey D. Bennett 2021-06-23 2374 int err;
e914d8432cb4b9 Geoffrey D. Bennett 2021-06-23 2375
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2376 /* monitor_other_enable[0] enables speaker switching
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2377 * monitor_other_enable[1] enables talkback
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2378 */
e914d8432cb4b9 Geoffrey D. Bennett 2021-06-23 2379 u8 monitor_other_enable[2];
e914d8432cb4b9 Geoffrey D. Bennett 2021-06-23 2380
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2381 /* monitor_other_switch[0] activates the alternate speakers
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2382 * monitor_other_switch[1] activates talkback
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2383 */
e914d8432cb4b9 Geoffrey D. Bennett 2021-06-23 2384 u8 monitor_other_switch[2];
6ef9fa4a0eb4cd Geoffrey D. Bennett 2021-06-23 2385
6ef9fa4a0eb4cd Geoffrey D. Bennett 2021-06-23 2386 private->monitor_other_updated = 0;
6ef9fa4a0eb4cd Geoffrey D. Bennett 2021-06-23 2387
6ef9fa4a0eb4cd Geoffrey D. Bennett 2021-06-23 2388 if (info->direct_monitor)
6ef9fa4a0eb4cd Geoffrey D. Bennett 2021-06-23 2389 return scarlett2_usb_get_config(
6ef9fa4a0eb4cd Geoffrey D. Bennett 2021-06-23 2390 mixer, SCARLETT2_CONFIG_DIRECT_MONITOR,
6ef9fa4a0eb4cd Geoffrey D. Bennett 2021-06-23 2391 1, &private->direct_monitor_switch);
6ef9fa4a0eb4cd Geoffrey D. Bennett 2021-06-23 2392
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2393 /* if it doesn't do speaker switching then it also doesn't do
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2394 * talkback
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2395 */
e914d8432cb4b9 Geoffrey D. Bennett 2021-06-23 2396 if (!info->has_speaker_switching)
e914d8432cb4b9 Geoffrey D. Bennett 2021-06-23 2397 return 0;
e914d8432cb4b9 Geoffrey D. Bennett 2021-06-23 2398
e914d8432cb4b9 Geoffrey D. Bennett 2021-06-23 2399 err = scarlett2_usb_get_config(
e914d8432cb4b9 Geoffrey D. Bennett 2021-06-23 2400 mixer, SCARLETT2_CONFIG_MONITOR_OTHER_ENABLE,
e914d8432cb4b9 Geoffrey D. Bennett 2021-06-23 2401 2, monitor_other_enable);
e914d8432cb4b9 Geoffrey D. Bennett 2021-06-23 2402 if (err < 0)
e914d8432cb4b9 Geoffrey D. Bennett 2021-06-23 2403 return err;
e914d8432cb4b9 Geoffrey D. Bennett 2021-06-23 2404
e914d8432cb4b9 Geoffrey D. Bennett 2021-06-23 2405 err = scarlett2_usb_get_config(
e914d8432cb4b9 Geoffrey D. Bennett 2021-06-23 2406 mixer, SCARLETT2_CONFIG_MONITOR_OTHER_SWITCH,
e914d8432cb4b9 Geoffrey D. Bennett 2021-06-23 2407 2, monitor_other_switch);
e914d8432cb4b9 Geoffrey D. Bennett 2021-06-23 2408 if (err < 0)
e914d8432cb4b9 Geoffrey D. Bennett 2021-06-23 2409 return err;
e914d8432cb4b9 Geoffrey D. Bennett 2021-06-23 2410
e914d8432cb4b9 Geoffrey D. Bennett 2021-06-23 2411 if (!monitor_other_enable[0])
e914d8432cb4b9 Geoffrey D. Bennett 2021-06-23 2412 private->speaker_switching_switch = 0;
e914d8432cb4b9 Geoffrey D. Bennett 2021-06-23 2413 else
e914d8432cb4b9 Geoffrey D. Bennett 2021-06-23 2414 private->speaker_switching_switch = monitor_other_switch[0] + 1;
e914d8432cb4b9 Geoffrey D. Bennett 2021-06-23 2415
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2416 if (info->has_talkback) {
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2417 const int (*port_count)[SCARLETT2_PORT_DIRNS] =
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2418 info->port_count;
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2419 int num_mixes =
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2420 port_count[SCARLETT2_PORT_TYPE_MIX][SCARLETT2_PORT_IN];
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2421 u16 bitmap;
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2422 int i;
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2423
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2424 if (!monitor_other_enable[1])
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2425 private->talkback_switch = 0;
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2426 else
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2427 private->talkback_switch = monitor_other_switch[1] + 1;
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2428
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 @2429 err = scarlett2_usb_get_config(mixer,
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2430 SCARLETT2_CONFIG_TALKBACK_MAP,
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2431 1, &bitmap);
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2432 for (i = 0; i < num_mixes; i++, bitmap >>= 1)
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2433 private->talkback_map[i] = bitmap & 1;
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2434 }
d5bda7e03982f6 Geoffrey D. Bennett 2021-06-23 2435
6ef9fa4a0eb4cd Geoffrey D. Bennett 2021-06-23 2436 return 0;
6ef9fa4a0eb4cd Geoffrey D. Bennett 2021-06-23 2437 }
6ef9fa4a0eb4cd Geoffrey D. Bennett 2021-06-23 2438
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months, 1 week
arch/powerpc/kernel/security.c:807:0-23: WARNING: fops_entry_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Michael Ellerman <mpe(a)ellerman.id.au>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 6880fa6c56601bb8ed59df6c30fd390cc5f6dd8f
commit: c6b4c9147f8b85d159f670d7bce71a93d16062a2 powerpc/64: Move security code into security.c
date: 5 months ago
:::::: branch date: 11 hours ago
:::::: commit date: 5 months ago
config: powerpc64-randconfig-c003-20210912 (attached as .config)
compiler: powerpc-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>
Reported-by: Julia Lawall <julia.lawall(a)lip6.fr>
cocci warnings: (new ones prefixed by >>)
>> arch/powerpc/kernel/security.c:807:0-23: WARNING: fops_entry_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE
>> arch/powerpc/kernel/security.c:781:0-23: WARNING: fops_rfi_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE
>> arch/powerpc/kernel/security.c:833:0-23: WARNING: fops_uaccess_flush should be defined with DEFINE_DEBUGFS_ATTRIBUTE
Please review and possibly fold the followup patch.
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
8 months, 1 week