[linux-next:master 951/8804] drivers/leds/flash/leds-as3645a.c:382:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   f26c3abc432a2026ba9ee7767061a1f88aead6ec
commit: f5d69f6290a37f5579ef24334d5bf8a59bb13ef4 [951/8804] leds: as3645a: Move driver to flash subdirectory
config: arm-randconfig-c002-20210816 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project af7818093677dcb4c0840aef96bc029deb219e57)
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://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=f5d69f6290a37f5579ef24334d5bf8a59bb13ef4
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout f5d69f6290a37f5579ef24334d5bf8a59bb13ef4
        # 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@xxxxxxxxx>


clang-analyzer warnings: (new ones prefixed by >>)
                             ^
   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)
           ^
   note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/compiler_types.h:328:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:306:2: note: expanded from macro '__compiletime_assert'
           do {                                                            \
           ^
   sound/core/device.c:228:2: note: Loop condition is false. Execution continues on line 237
           list_for_each_entry_safe_reverse(dev, next, &card->devices, list) {
           ^
   include/linux/list.h:762:2: note: expanded from macro 'list_for_each_entry_safe_reverse'
           for (pos = list_last_entry(head, typeof(*pos), member),         \
           ^
   sound/core/device.c:237:2: note: Left side of '&&' is false
           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)
           ^
   include/linux/kernel.h:495:61: note: expanded from macro 'container_of'
           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:328:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:308: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:328:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:306: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:494:25: note: expanded from macro 'container_of'
           void *__mptr = (void *)(ptr);                                   \
                                  ^~~~~
   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.
   4 warnings generated.
>> drivers/leds/flash/leds-as3645a.c:382:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct device *dev = &flash->client->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~~~
   drivers/leds/flash/leds-as3645a.c:382:17: note: Value stored to 'dev' during its initialization is never read
           struct device *dev = &flash->client->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~~~
   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.
   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.
   4 warnings generated.
   sound/soc/codecs/wm8903.c:434:3: warning: Value stored to 'best' is never read [clang-analyzer-deadcode.DeadStores]
                   best = 0;
                   ^      ~
   sound/soc/codecs/wm8903.c:434:3: note: Value stored to 'best' is never read
                   best = 0;
                   ^      ~
   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.
   sound/soc/codecs/wm8960.c:508:18: warning: Access to field 'lout1' results in a dereference of a null pointer (loaded from variable 'wm8960') [clang-analyzer-core.NullDereference]
                           wm8960->lout1 = w;
                                         ^
   sound/soc/codecs/wm8960.c:1345:6: note: Assuming field 'capless' is false
           if (pdata->capless)
               ^~~~~~~~~~~~~~
   sound/soc/codecs/wm8960.c:1345:2: note: Taking false branch
           if (pdata->capless)
           ^
   sound/soc/codecs/wm8960.c:1352:2: note: Calling 'wm8960_add_widgets'
           wm8960_add_widgets(component);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/wm8960.c:472:2: note: 'wm8960' initialized here
           struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/wm8960.c:485:6: note: Assuming 'pdata' is null
           if (pdata && pdata->capless) {
               ^~~~~
   sound/soc/codecs/wm8960.c:485:12: note: Left side of '&&' is false
           if (pdata && pdata->capless) {
                     ^
   sound/soc/codecs/wm8960.c:504:2: note: Left side of '&&' is false
           list_for_each_entry(w, &component->card->widgets, list) {
           ^
   include/linux/list.h:628:13: note: expanded from macro 'list_for_each_entry'
           for (pos = list_first_entry(head, typeof(*pos), member);        \
                      ^
   include/linux/list.h:522:2: note: expanded from macro 'list_first_entry'
           list_entry((ptr)->next, type, member)
           ^
   include/linux/list.h:511:2: note: expanded from macro 'list_entry'
           container_of(ptr, type, member)
           ^
   include/linux/kernel.h:495:61: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
                                                                      ^
   sound/soc/codecs/wm8960.c:504:2: note: Taking false branch
           list_for_each_entry(w, &component->card->widgets, list) {
           ^
   include/linux/list.h:628:13: note: expanded from macro 'list_for_each_entry'
           for (pos = list_first_entry(head, typeof(*pos), member);        \
                      ^
   include/linux/list.h:522:2: note: expanded from macro 'list_first_entry'
           list_entry((ptr)->next, 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:328:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:316:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:308:3: note: expanded from macro '__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   sound/soc/codecs/wm8960.c:504:2: note: Loop condition is false.  Exiting loop
           list_for_each_entry(w, &component->card->widgets, list) {
           ^
   include/linux/list.h:628:13: note: expanded from macro 'list_for_each_entry'
           for (pos = list_first_entry(head, typeof(*pos), member);        \
                      ^
   include/linux/list.h:522:2: note: expanded from macro 'list_first_entry'
           list_entry((ptr)->next, type, member)
           ^
   include/linux/list.h:511:2: note: expanded from macro 'list_entry'

vim +/dev +382 drivers/leds/flash/leds-as3645a.c

a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  379  
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  380  static int as3645a_setup(struct as3645a *flash)
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  381  {
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26 @382  	struct device *dev = &flash->client->dev;
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  383  	u32 fault = 0;
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  384  	int rval;
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  385  
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  386  	/* clear errors */
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  387  	rval = as3645a_read(flash, AS_FAULT_INFO_REG);
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  388  	if (rval < 0)
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  389  		return rval;
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  390  
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  391  	dev_dbg(dev, "Fault info: %02x\n", rval);
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  392  
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  393  	rval = as3645a_set_current(flash);
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  394  	if (rval < 0)
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  395  		return rval;
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  396  
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  397  	rval = as3645a_set_timeout(flash);
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  398  	if (rval < 0)
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  399  		return rval;
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  400  
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  401  	rval = as3645a_set_control(flash, AS_MODE_INDICATOR, false);
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  402  	if (rval < 0)
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  403  		return rval;
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  404  
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  405  	/* read status */
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  406  	rval = as3645a_get_fault(&flash->fled, &fault);
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  407  	if (rval < 0)
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  408  		return rval;
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  409  
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  410  	dev_dbg(dev, "AS_INDICATOR_AND_TIMER_REG: %02x\n",
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  411  		as3645a_read(flash, AS_INDICATOR_AND_TIMER_REG));
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  412  	dev_dbg(dev, "AS_CURRENT_SET_REG: %02x\n",
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  413  		as3645a_read(flash, AS_CURRENT_SET_REG));
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  414  	dev_dbg(dev, "AS_CONTROL_REG: %02x\n",
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  415  		as3645a_read(flash, AS_CONTROL_REG));
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  416  
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  417  	return rval & ~AS_FAULT_INFO_LED_AMOUNT ? -EIO : 0;
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  418  }
a56ba8fbcb55f3 drivers/leds/leds-as3645a.c Sakari Ailus 2015-04-26  419  

:::::: The code at line 382 was first introduced by commit
:::::: a56ba8fbcb55f3c5fc06f803469e7412f9e13c18 media: leds: as3645a: Add LED flash class driver

:::::: TO: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>
:::::: CC: Mauro Carvalho Chehab <mchehab@xxxxxxxxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux