CC: [email protected]
CC: [email protected]
BCC: [email protected]
CC: [email protected]
TO: Johan Hovold <[email protected]>
CC: "Greg Kroah-Hartman" <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   52d543b5497cf31d6baeb0bcfe5a5474c3238578
commit: b3431093ad05c5242d87fcf94bddc7a84a2134f5 USB: serial: refactor endpoint 
classification
date:   12 months ago
:::::: branch date: 7 hours ago
:::::: commit date: 12 months ago
config: arm-randconfig-c002-20220324 
(https://download.01.org/0day-ci/archive/20220326/[email protected]/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 
902f4708fe1d03b0de7e5315ef875006a6adc319)
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/torvalds/linux.git/commit/?id=b3431093ad05c5242d87fcf94bddc7a84a2134f5
        git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout b3431093ad05c5242d87fcf94bddc7a84a2134f5
        # save the config file 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 <[email protected]>


clang-analyzer warnings: (new ones prefixed by >>)
           dev_dbg(fe->dvb->device, "%s:\n", __func__);
           ^
   include/linux/dev_printk.h:130:2: note: expanded from macro 'dev_dbg'
           if (0)                                                          \
           ^
   drivers/media/dvb-core/dvb_frontend.c:247:7: note: Assuming the condition is 
true
           if ((status & FE_HAS_LOCK) && has_get_frontend(fe))
                ^~~~~~~~~~~~~~~~~~~~
   drivers/media/dvb-core/dvb_frontend.c:247:6: note: Left side of '&&' is true
           if ((status & FE_HAS_LOCK) && has_get_frontend(fe))
               ^
   drivers/media/dvb-core/dvb_frontend.c:247:32: note: Assuming the condition 
is true
           if ((status & FE_HAS_LOCK) && has_get_frontend(fe))
                                         ^~~~~~~~~~~~~~~~~~~~
   drivers/media/dvb-core/dvb_frontend.c:247:2: note: Taking true branch
           if ((status & FE_HAS_LOCK) && has_get_frontend(fe))
           ^
   drivers/media/dvb-core/dvb_frontend.c:252:8: note: Access to field 'eventw' 
results in a dereference of a null pointer (loaded from variable 'events')
           wp = (events->eventw + 1) % MAX_EVENT;
                 ^~~~~~
   drivers/media/dvb-core/dvb_frontend.c:354:23: warning: Value stored to 'fe' 
during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct dvb_frontend *fe = fepriv->dvbdev->priv;
                                ^~   ~~~~~~~~~~~~~~~~~~~~
   drivers/media/dvb-core/dvb_frontend.c:354:23: note: Value stored to 'fe' 
during its initialization is never read
           struct dvb_frontend *fe = fepriv->dvbdev->priv;
                                ^~   ~~~~~~~~~~~~~~~~~~~~
   Suppressed 2 warnings (1 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.
   3 warnings generated.
   drivers/usb/serial/ir-usb.c:96:17: warning: Value stored to 'dev' during its 
initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct device *dev = &serial->dev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~
   drivers/usb/serial/ir-usb.c:96:17: note: Value stored to 'dev' during its 
initialization is never read
           struct device *dev = &serial->dev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~
   drivers/usb/serial/ir-usb.c:209:2: warning: Value stored to 'rates' is never 
read [clang-analyzer-deadcode.DeadStores]
           rates = le16_to_cpu(irda_desc->wBaudRate);
           ^
   drivers/usb/serial/ir-usb.c:209:2: note: Value stored to 'rates' is never 
read
   Suppressed 1 warnings (1 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/usb/serial/keyspan.c:771:2: warning: Value stored to 'endpoint' is 
never read [clang-analyzer-deadcode.DeadStores]
           endpoint = usb_pipeendpoint(urb->pipe);
           ^
   drivers/usb/serial/keyspan.c:771:2: note: Value stored to 'endpoint' is 
never read
   drivers/usb/serial/keyspan.c:829:2: warning: Value stored to 'p_priv' is 
never read [clang-analyzer-deadcode.DeadStores]
           p_priv = usb_get_serial_port_data(port);
           ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/serial/keyspan.c:829:2: note: Value stored to 'p_priv' is never 
read
           p_priv = usb_get_serial_port_data(port);
           ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/serial/keyspan.c:920:2: warning: Value stored to 'data' is never 
read [clang-analyzer-deadcode.DeadStores]
           data = urb->transfer_buffer;
           ^      ~~~~~~~~~~~~~~~~~~~~
   drivers/usb/serial/keyspan.c:920:2: note: Value stored to 'data' is never 
read
           data = urb->transfer_buffer;
           ^      ~~~~~~~~~~~~~~~~~~~~
   drivers/usb/serial/keyspan.c:1122:2: warning: Value stored to 'endpoint' is 
never read [clang-analyzer-deadcode.DeadStores]
           endpoint = usb_pipeendpoint(urb->pipe);
           ^
   drivers/usb/serial/keyspan.c:1122:2: note: Value stored to 'endpoint' is 
never read
   drivers/usb/serial/keyspan.c:1184:2: warning: Value stored to 'len' is never 
read [clang-analyzer-deadcode.DeadStores]
           len = 0;
           ^     ~
   drivers/usb/serial/keyspan.c:1184:2: note: Value stored to 'len' is never 
read
           len = 0;
           ^     ~
   drivers/usb/serial/keyspan.c:1251:2: warning: Value stored to 'endpoint' is 
never read [clang-analyzer-deadcode.DeadStores]
           endpoint = usb_pipeendpoint(urb->pipe);
           ^
   drivers/usb/serial/keyspan.c:1251:2: note: Value stored to 'endpoint' is 
never read
   drivers/usb/serial/keyspan.c:1732:3: warning: Value stored to 'ep_type_name' 
is never read [clang-analyzer-deadcode.DeadStores]
                   ep_type_name = "INT";
                   ^              ~~~~~
   drivers/usb/serial/keyspan.c:1732:3: note: Value stored to 'ep_type_name' is 
never read
                   ep_type_name = "INT";
                   ^              ~~~~~
   drivers/usb/serial/keyspan.c:1738:3: warning: Value stored to 'ep_type_name' 
is never read [clang-analyzer-deadcode.DeadStores]
                   ep_type_name = "BULK";
                   ^              ~~~~~~
   drivers/usb/serial/keyspan.c:1738:3: note: Value stored to 'ep_type_name' is 
never read
                   ep_type_name = "BULK";
                   ^              ~~~~~~
   Suppressed 1 warnings (1 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.
   drivers/usb/class/usblp.c:369:7: warning: Although the value stored to 
'error' is used in the enclosing expression, the value is never actually read 
from 'error' [clang-analyzer-deadcode.DeadStores]
           if ((error = usblp_read_status(usblp, usblp->statusbuf)) < 0) {
                ^
   drivers/usb/class/usblp.c:369:7: note: Although the value stored to 'error' 
is used in the enclosing expression, the value is never actually read from 
'error'
   Suppressed 1 warnings (1 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/usb/serial/usb-serial.c:718:17: warning: Value stored to 'dev' 
during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct device *dev = &serial->interface->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/serial/usb-serial.c:718:17: note: Value stored to 'dev' during 
its initialization is never read
           struct device *dev = &serial->interface->dev;
                          ^~~   ~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/usb/serial/usb-serial.c:719:5: warning: Value stored to 'addr' 
>> during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           u8 addr = epd->bEndpointAddress;
              ^~~~   ~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/serial/usb-serial.c:719:5: note: Value stored to 'addr' during 
its initialization is never read
           u8 addr = epd->bEndpointAddress;
              ^~~~   ~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/serial/usb-serial.c:1419:2: warning: Value stored to 'rc' is 
never read [clang-analyzer-deadcode.DeadStores]
           rc = driver_attach(&udriver->drvwrap.driver);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/usb/serial/usb-serial.c:1419:2: note: Value stored to 'rc' is never 
read
           rc = driver_attach(&udriver->drvwrap.driver);
           ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 1 warnings (1 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.
   include/linux/list.h:135:13: warning: Use of memory after it is freed 
[clang-analyzer-unix.Malloc]
           __list_del(entry->prev, entry->next);
                      ^
   sound/core/rawmidi.c:1756:9: note: Calling 'snd_rawmidi_free'
           return snd_rawmidi_free(rmidi);
                  ^~~~~~~~~~~~~~~~~~~~~~~
   sound/core/rawmidi.c:1734:6: note: Assuming 'rmidi' is non-null
           if (!rmidi)
               ^~~~~~
   sound/core/rawmidi.c:1734:2: note: Taking false branch
           if (!rmidi)
           ^
   sound/core/rawmidi.c:1740:6: note: Assuming field 'ops' is null
           if (rmidi->ops && rmidi->ops->dev_unregister)
               ^~~~~~~~~~
   sound/core/rawmidi.c:1740:17: note: Left side of '&&' is false
           if (rmidi->ops && rmidi->ops->dev_unregister)
                          ^
   sound/core/rawmidi.c:1744:2: note: Calling 'snd_rawmidi_free_substreams'
           
snd_rawmidi_free_substreams(&rmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT]);
           
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/core/rawmidi.c:1725:2: note: Loop condition is true.  Entering loop 
body
           while (!list_empty(&stream->substreams)) {
           ^
   sound/core/rawmidi.c:1726:15: note: Left side of '&&' is false
                   substream = list_entry(stream->substreams.next, struct 
snd_rawmidi_substream, list);
                               ^
   include/linux/list.h:511:2: note: expanded from macro 'list_entry'
           container_of(ptr, type, member)
           ^
   include/linux/kernel.h:709:61: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
                                                                      ^
   sound/core/rawmidi.c:1726:15: note: Taking false branch
                   substream = list_entry(stream->substreams.next, struct 
snd_rawmidi_substream, list);
                               ^
   include/linux/list.h:511:2: note: expanded from macro 'list_entry'
           container_of(ptr, type, member)
           ^
   include/linux/kernel.h:709: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:320:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:308:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:300:3: note: expanded from macro 
'__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   sound/core/rawmidi.c:1726:15: note: Loop condition is false.  Exiting loop
                   substream = list_entry(stream->substreams.next, struct 
snd_rawmidi_substream, list);
                               ^
   include/linux/list.h:511:2: note: expanded from macro 'list_entry'
           container_of(ptr, type, member)
           ^
   include/linux/kernel.h:709: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:320:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:308:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:298:2: note: expanded from macro 
'__compiletime_assert'
           do {                                                            \
           ^
   sound/core/rawmidi.c:1728:3: note: Memory is released
                   kfree(substream);
                   ^~~~~~~~~~~~~~~~
   sound/core/rawmidi.c:1725:2: note: Loop condition is true.  Entering loop 
body
           while (!list_empty(&stream->substreams)) {
           ^
   sound/core/rawmidi.c:1726:15: note: Left side of '&&' is false
                   substream = list_entry(stream->substreams.next, struct 
snd_rawmidi_substream, list);
                               ^
   include/linux/list.h:511:2: note: expanded from macro 'list_entry'
           container_of(ptr, type, member)

vim +/addr +719 drivers/usb/serial/usb-serial.c

335f8514f200e63 Alan Cox     2009-06-11  713  
b3431093ad05c52 Johan Hovold 2021-03-30  714  static void store_endpoint(struct 
usb_serial *serial,
b3431093ad05c52 Johan Hovold 2021-03-30  715                                    
struct usb_serial_endpoints *epds,
b3431093ad05c52 Johan Hovold 2021-03-30  716                                    
struct usb_endpoint_descriptor *epd)
1546e6aecb2490c Johan Hovold 2014-08-21  717  {
1546e6aecb2490c Johan Hovold 2014-08-21 @718    struct device *dev = 
&serial->interface->dev;
b3431093ad05c52 Johan Hovold 2021-03-30 @719    u8 addr = epd->bEndpointAddress;
1546e6aecb2490c Johan Hovold 2014-08-21  720  
1546e6aecb2490c Johan Hovold 2014-08-21  721    if 
(usb_endpoint_is_bulk_in(epd)) {
b3431093ad05c52 Johan Hovold 2021-03-30  722            if (epds->num_bulk_in 
== ARRAY_SIZE(epds->bulk_in))
b3431093ad05c52 Johan Hovold 2021-03-30  723                    return;
b3431093ad05c52 Johan Hovold 2021-03-30  724            dev_dbg(dev, "found 
bulk in endpoint %02x\n", addr);
1546e6aecb2490c Johan Hovold 2014-08-21  725            
epds->bulk_in[epds->num_bulk_in++] = epd;
1546e6aecb2490c Johan Hovold 2014-08-21  726    } else if 
(usb_endpoint_is_bulk_out(epd)) {
b3431093ad05c52 Johan Hovold 2021-03-30  727            if (epds->num_bulk_out 
== ARRAY_SIZE(epds->bulk_out))
b3431093ad05c52 Johan Hovold 2021-03-30  728                    return;
b3431093ad05c52 Johan Hovold 2021-03-30  729            dev_dbg(dev, "found 
bulk out endpoint %02x\n", addr);
1546e6aecb2490c Johan Hovold 2014-08-21  730            
epds->bulk_out[epds->num_bulk_out++] = epd;
1546e6aecb2490c Johan Hovold 2014-08-21  731    } else if 
(usb_endpoint_is_int_in(epd)) {
b3431093ad05c52 Johan Hovold 2021-03-30  732            if 
(epds->num_interrupt_in == ARRAY_SIZE(epds->interrupt_in))
b3431093ad05c52 Johan Hovold 2021-03-30  733                    return;
b3431093ad05c52 Johan Hovold 2021-03-30  734            dev_dbg(dev, "found 
interrupt in endpoint %02x\n", addr);
1546e6aecb2490c Johan Hovold 2014-08-21  735            
epds->interrupt_in[epds->num_interrupt_in++] = epd;
1546e6aecb2490c Johan Hovold 2014-08-21  736    } else if 
(usb_endpoint_is_int_out(epd)) {
b3431093ad05c52 Johan Hovold 2021-03-30  737            if 
(epds->num_interrupt_out == ARRAY_SIZE(epds->interrupt_out))
b3431093ad05c52 Johan Hovold 2021-03-30  738                    return;
b3431093ad05c52 Johan Hovold 2021-03-30  739            dev_dbg(dev, "found 
interrupt out endpoint %02x\n", addr);
1546e6aecb2490c Johan Hovold 2014-08-21  740            
epds->interrupt_out[epds->num_interrupt_out++] = epd;
1546e6aecb2490c Johan Hovold 2014-08-21  741    }
1546e6aecb2490c Johan Hovold 2014-08-21  742  }
b3431093ad05c52 Johan Hovold 2021-03-30  743  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to