All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH] media: i2c: Add driver for DW9719 VCM
Date: Sun, 05 Dec 2021 03:34:06 +0800	[thread overview]
Message-ID: <202112050308.lEaCEX4U-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 17151 bytes --]

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20211128232115.38833-1-djrscally@gmail.com>
References: <20211128232115.38833-1-djrscally@gmail.com>
TO: Daniel Scally <djrscally@gmail.com>
TO: linux-media(a)vger.kernel.org
CC: sakari.ailus(a)linux.intel.com
CC: hdegoede(a)redhat.com
CC: laurent.pinchart(a)ideasonboard.com
CC: kieran.bingham(a)ideasonboard.com

Hi Daniel,

I love your patch! Perhaps something to improve:

[auto build test WARNING on media-tree/master]
[also build test WARNING on linus/master v5.16-rc3 next-20211203]
[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/Daniel-Scally/media-i2c-Add-driver-for-DW9719-VCM/20211129-072436
base:   git://linuxtv.org/media_tree.git master
:::::: branch date: 6 days ago
:::::: commit date: 6 days ago
config: i386-randconfig-c001-20211130 (https://download.01.org/0day-ci/archive/20211205/202112050308.lEaCEX4U-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 25eb7fa01d7ebbe67648ea03841cda55b4239ab2)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/8bbbe049053a268d99463f6fda429d0af571a27a
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Daniel-Scally/media-i2c-Add-driver-for-DW9719-VCM/20211129-072436
        git checkout 8bbbe049053a268d99463f6fda429d0af571a27a
        # save the config file 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@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
               ^~~~~
   sound/drivers/vx/vx_pcm.c:217:2: note: Taking false branch
           if (! err)
           ^
   sound/drivers/vx/vx_pcm.c:219:2: note: Returning without writing to '*state'
           return err;
           ^
   sound/drivers/vx/vx_pcm.c:323:6: note: Returning from 'vx_get_pipe_state'
           if (vx_get_pipe_state(chip, pipe, &cur_state) < 0)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/drivers/vx/vx_pcm.c:323:6: note: Assuming the condition is false
           if (vx_get_pipe_state(chip, pipe, &cur_state) < 0)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/drivers/vx/vx_pcm.c:323:2: note: Taking false branch
           if (vx_get_pipe_state(chip, pipe, &cur_state) < 0)
           ^
   sound/drivers/vx/vx_pcm.c:325:12: note: The right operand of '==' is a garbage value
           if (state == cur_state)
                     ^  ~~~~~~~~~
   sound/drivers/vx/vx_pcm.c:1225:3: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
                   strcpy(pcm->name, chip->card->shortname);
                   ^~~~~~
   sound/drivers/vx/vx_pcm.c:1225:3: note: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119
                   strcpy(pcm->name, chip->card->shortname);
                   ^~~~~~
   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.
   8 warnings generated.
   sound/drivers/vx/vx_mixer.c:836:55: warning: The left operand of '>>' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
           ucontrol->value.integer.value[0] = meter[0].vu_level >> METER_SHIFT;
                                              ~~~~~~~~~~~~~~~~~ ^
   sound/drivers/vx/vx_mixer.c:835:2: note: Calling 'vx_get_audio_vu_meter'
           vx_get_audio_vu_meter(chip, audio, capture, meter);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/drivers/vx/vx_mixer.c:367:6: note: Assuming the condition is true
           if (chip->chip_status & VX_STAT_IS_STALE)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/drivers/vx/vx_mixer.c:367:2: note: Taking true branch
           if (chip->chip_status & VX_STAT_IS_STALE)
           ^
   sound/drivers/vx/vx_mixer.c:368:3: note: Returning without writing to 'info->vu_level'
                   return -EBUSY;
                   ^
   sound/drivers/vx/vx_mixer.c:835:2: note: Returning from 'vx_get_audio_vu_meter'
           vx_get_audio_vu_meter(chip, audio, capture, meter);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/drivers/vx/vx_mixer.c:836:55: note: The left operand of '>>' is a garbage value
           ucontrol->value.integer.value[0] = meter[0].vu_level >> METER_SHIFT;
                                              ~~~~~~~~~~~~~~~~~ ^
   sound/drivers/vx/vx_mixer.c:849:57: warning: The left operand of '>>' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
           ucontrol->value.integer.value[0] = meter[0].peak_level >> METER_SHIFT;
                                              ~~~~~~~~~~~~~~~~~~~ ^
   sound/drivers/vx/vx_mixer.c:848:2: note: Calling 'vx_get_audio_vu_meter'
           vx_get_audio_vu_meter(chip, audio, capture, meter);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/drivers/vx/vx_mixer.c:367:6: note: Assuming the condition is true
           if (chip->chip_status & VX_STAT_IS_STALE)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/drivers/vx/vx_mixer.c:367:2: note: Taking true branch
           if (chip->chip_status & VX_STAT_IS_STALE)
           ^
   sound/drivers/vx/vx_mixer.c:368:3: note: Returning without writing to 'info->peak_level'
                   return -EBUSY;
                   ^
   sound/drivers/vx/vx_mixer.c:848:2: note: Returning from 'vx_get_audio_vu_meter'
           vx_get_audio_vu_meter(chip, audio, capture, meter);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/drivers/vx/vx_mixer.c:849:57: note: The left operand of '>>' is a garbage value
           ucontrol->value.integer.value[0] = meter[0].peak_level >> METER_SHIFT;
                                              ~~~~~~~~~~~~~~~~~~~ ^
   sound/drivers/vx/vx_mixer.c:863:35: warning: Assigned value is garbage or undefined [clang-analyzer-core.uninitialized.Assign]
           ucontrol->value.integer.value[0] = meter[0].saturated;
                                            ^ ~~~~~~~~~~~~~~~~~~
   sound/drivers/vx/vx_mixer.c:862:2: note: Calling 'vx_get_audio_vu_meter'
           vx_get_audio_vu_meter(chip, audio, 1, meter); /* capture only */
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/drivers/vx/vx_mixer.c:367:6: note: Assuming the condition is true
           if (chip->chip_status & VX_STAT_IS_STALE)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/drivers/vx/vx_mixer.c:367:2: note: Taking true branch
           if (chip->chip_status & VX_STAT_IS_STALE)
           ^
   sound/drivers/vx/vx_mixer.c:368:3: note: Returning without writing to 'info->saturated'
                   return -EBUSY;
                   ^
   sound/drivers/vx/vx_mixer.c:862:2: note: Returning from 'vx_get_audio_vu_meter'
           vx_get_audio_vu_meter(chip, audio, 1, meter); /* capture only */
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/drivers/vx/vx_mixer.c:863:35: note: Assigned value is garbage or undefined
           ucontrol->value.integer.value[0] = meter[0].saturated;
                                            ^ ~~~~~~~~~~~~~~~~~~
   sound/drivers/vx/vx_mixer.c:906:2: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
           strcpy(card->mixername, card->driver);
           ^~~~~~
   sound/drivers/vx/vx_mixer.c:906:2: note: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119
           strcpy(card->mixername, card->driver);
           ^~~~~~
   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.
   9 warnings generated.
>> drivers/media/i2c/dw9719.c:126:3: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
                   ret = -ENXIO;
                   ^     ~~~~~~
   drivers/media/i2c/dw9719.c:126:3: note: Value stored to 'ret' is never read
                   ret = -ENXIO;
                   ^     ~~~~~~
   drivers/media/i2c/dw9719.c:146:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
           ret = dw9719_i2c_wr8(dw9719->client, DW9719_CONTROL, 1);
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/i2c/dw9719.c:146:2: note: Value stored to 'ret' is never read
           ret = dw9719_i2c_wr8(dw9719->client, DW9719_CONTROL, 1);
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 7 warnings (7 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.
   Suppressed 7 warnings (7 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.
   Suppressed 7 warnings (7 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/media/i2c/adv7175.c:416:3: warning: Value stored to 'i' is never read [clang-analyzer-deadcode.DeadStores]
                   i = adv7175_write(sd, 0x07, TR0MODE | TR0RST);
                   ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/i2c/adv7175.c:416:3: note: Value stored to 'i' is never read
                   i = adv7175_write(sd, 0x07, TR0MODE | TR0RST);
                   ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/i2c/adv7175.c:417:3: warning: Value stored to 'i' is never read [clang-analyzer-deadcode.DeadStores]
                   i = adv7175_write(sd, 0x07, TR0MODE);
                   ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/i2c/adv7175.c:417:3: note: Value stored to 'i' is never read
                   i = adv7175_write(sd, 0x07, TR0MODE);
                   ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 7 warnings (7 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.
   Suppressed 7 warnings (7 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.
   Suppressed 7 warnings (7 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.
   Suppressed 7 warnings (7 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.
   Suppressed 7 warnings (7 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 (8 in non-user code, 10 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.
   11 warnings generated.
   drivers/media/i2c/adv7842.c:3499:60: warning: The result of the left shift is undefined because the left operand is negative [clang-analyzer-core.UndefinedBinaryOperatorResult]
           rev = adv_smbus_read_byte_data_check(client, 0xea, false) << 8 |
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
   drivers/media/i2c/adv7842.c:3469:7: note: Calling 'i2c_check_functionality'
           if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/i2c.h:913:9: note: Assuming the condition is true
           return (func & i2c_get_functionality(adap)) == func;
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/i2c.h:913:2: note: Returning the value 1, which participates in a condition later
           return (func & i2c_get_functionality(adap)) == func;
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/i2c/adv7842.c:3469:7: note: Returning from 'i2c_check_functionality'
           if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/i2c/adv7842.c:3469:2: note: Taking false branch
           if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
           ^
   drivers/media/i2c/adv7842.c:3472:13: note: Assuming 'debug' is < 1
           v4l_dbg(1, debug, client, "detecting adv7842 client on address 0x%x\n",
                      ^
   include/media/v4l2-common.h:43:7: note: expanded from macro 'v4l_dbg'
                   if (debug >= (level))                                        \
                       ^~~~~~~~~~~~~~~~
   drivers/media/i2c/adv7842.c:3472:2: note: Taking false branch
           v4l_dbg(1, debug, client, "detecting adv7842 client on address 0x%x\n",
           ^
   include/media/v4l2-common.h:43:3: note: expanded from macro 'v4l_dbg'
                   if (debug >= (level))                                        \
                   ^
   drivers/media/i2c/adv7842.c:3472:2: note: Loop condition is false.  Exiting loop
           v4l_dbg(1, debug, client, "detecting adv7842 client on address 0x%x\n",
           ^
   include/media/v4l2-common.h:42:2: note: expanded from macro 'v4l_dbg'
           do {                                                                 \
           ^
   drivers/media/i2c/adv7842.c:3475:6: note: Assuming 'pdata' is non-null
           if (!pdata) {
               ^~~~~~
   drivers/media/i2c/adv7842.c:3475:2: note: Taking false branch
           if (!pdata) {
           ^
   drivers/media/i2c/adv7842.c:3481:6: note: Assuming 'state' is non-null
           if (!state)
               ^~~~~~
   drivers/media/i2c/adv7842.c:3481:2: note: Taking false branch
           if (!state)
           ^
   drivers/media/i2c/adv7842.c:3495:23: note: Assuming field 'input' is not equal to ADV7842_SELECT_HDMI_PORT_A
           state->hdmi_port_a = pdata->input == ADV7842_SELECT_HDMI_PORT_A;

vim +/ret +126 drivers/media/i2c/dw9719.c

8bbbe049053a26 Daniel Scally 2021-11-28  114  
8bbbe049053a26 Daniel Scally 2021-11-28  115  static int dw9719_detect(struct dw9719_device *dw9719)
8bbbe049053a26 Daniel Scally 2021-11-28  116  {
8bbbe049053a26 Daniel Scally 2021-11-28  117  	int ret;
8bbbe049053a26 Daniel Scally 2021-11-28  118  	u8 val;
8bbbe049053a26 Daniel Scally 2021-11-28  119  
8bbbe049053a26 Daniel Scally 2021-11-28  120  	ret = dw9719_i2c_rd8(dw9719->client, DW9719_INFO, &val);
8bbbe049053a26 Daniel Scally 2021-11-28  121  	if (ret < 0)
8bbbe049053a26 Daniel Scally 2021-11-28  122  		return ret;
8bbbe049053a26 Daniel Scally 2021-11-28  123  
8bbbe049053a26 Daniel Scally 2021-11-28  124  	if (val != DW9719_ID) {
8bbbe049053a26 Daniel Scally 2021-11-28  125  		dev_err(dw9719->dev, "Failed to detect correct id\n");
8bbbe049053a26 Daniel Scally 2021-11-28 @126  		ret = -ENXIO;
8bbbe049053a26 Daniel Scally 2021-11-28  127  	}
8bbbe049053a26 Daniel Scally 2021-11-28  128  
8bbbe049053a26 Daniel Scally 2021-11-28  129  	return 0;
8bbbe049053a26 Daniel Scally 2021-11-28  130  }
8bbbe049053a26 Daniel Scally 2021-11-28  131  

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

             reply	other threads:[~2021-12-04 19:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-04 19:34 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-11-28 23:21 [PATCH] media: i2c: Add driver for DW9719 VCM Daniel Scally
2022-01-19 12:19 ` Sakari Ailus
2022-01-19 15:14   ` Daniel Scally

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202112050308.lEaCEX4U-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.