public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Jimmy Su <jimmy.su@intel.com>,
	linux-media@vger.kernel.org
Cc: lkp@intel.com, kbuild-all@lists.01.org,
	sakari.ailus@linux.intel.com, andy.yeh@intel.com,
	jimmy.su@intel.com, yhuang@ovt.com, akeem.chen@ovt.com
Subject: Re: [PATCH v2] UPSTREAM: media: ov8856: skip OTP read in non-zero ACPI D state
Date: Mon, 16 May 2022 14:30:43 +0300	[thread overview]
Message-ID: <202205131109.giBGpLnO-lkp@intel.com> (raw)
In-Reply-To: <20220510151241.12435-1-jimmy.su@intel.com>

Hi Jimmy,

url:    https://github.com/intel-lab-lkp/linux/commits/Jimmy-Su/UPSTREAM-media-ov8856-skip-OTP-read-in-non-zero-ACPI-D-state/20220510-232606
base:   git://linuxtv.org/media_tree.git master
config: nios2-randconfig-m031-20220512 (https://download.01.org/0day-ci/archive/20220513/202205131109.giBGpLnO-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 11.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/media/i2c/ov8856.c:1715 ov8856_identify_module() warn: maybe use && instead of &

vim +1715 drivers/media/i2c/ov8856.c

0e014f1a8d546f Bingbu Cao 2021-12-15  1694  static int ov8856_identify_module(struct ov8856 *ov8856)
0e014f1a8d546f Bingbu Cao 2021-12-15  1695  {
0e014f1a8d546f Bingbu Cao 2021-12-15  1696  	struct i2c_client *client = v4l2_get_subdevdata(&ov8856->sd);
0e014f1a8d546f Bingbu Cao 2021-12-15  1697  	int ret;
25bf233398211c Jimmy Su   2022-05-10  1698  	u32 val, width;
0e014f1a8d546f Bingbu Cao 2021-12-15  1699  
0e014f1a8d546f Bingbu Cao 2021-12-15  1700  	if (ov8856->identified)
0e014f1a8d546f Bingbu Cao 2021-12-15  1701  		return 0;
0e014f1a8d546f Bingbu Cao 2021-12-15  1702  
0e014f1a8d546f Bingbu Cao 2021-12-15  1703  	ret = ov8856_read_reg(ov8856, OV8856_REG_CHIP_ID,
0e014f1a8d546f Bingbu Cao 2021-12-15  1704  			      OV8856_REG_VALUE_24BIT, &val);
0e014f1a8d546f Bingbu Cao 2021-12-15  1705  	if (ret)
0e014f1a8d546f Bingbu Cao 2021-12-15  1706  		return ret;
0e014f1a8d546f Bingbu Cao 2021-12-15  1707  
0e014f1a8d546f Bingbu Cao 2021-12-15  1708  	if (val != OV8856_CHIP_ID) {
0e014f1a8d546f Bingbu Cao 2021-12-15  1709  		dev_err(&client->dev, "chip id mismatch: %x!=%x",
0e014f1a8d546f Bingbu Cao 2021-12-15  1710  			OV8856_CHIP_ID, val);
0e014f1a8d546f Bingbu Cao 2021-12-15  1711  		return -ENXIO;
0e014f1a8d546f Bingbu Cao 2021-12-15  1712  	}
0e014f1a8d546f Bingbu Cao 2021-12-15  1713  
25bf233398211c Jimmy Su   2022-05-10  1714  	width = ov8856->cur_mode->width;
25bf233398211c Jimmy Su   2022-05-10 @1715  	if (ov8856->acpi_skip_otp & ((width == 3280) | (width == 1640)))

I think Smatch will not print a warning for this if ->acpi_skip_otp is
declared as bool or if Smatch can determine that it is boolean from
the context, but the kbuild-bot does not do cross function analysis.

But to a human, the naming seems pretty likely that ov8856->acpi_skip_otp
so && and & are equivalent.

However && is more readable.

25bf233398211c Jimmy Su   2022-05-10  1716  		goto otp_skip;
25bf233398211c Jimmy Su   2022-05-10  1717  
0e014f1a8d546f Bingbu Cao 2021-12-15  1718  	ret = ov8856_write_reg(ov8856, OV8856_REG_MODE_SELECT,
0e014f1a8d546f Bingbu Cao 2021-12-15  1719  			       OV8856_REG_VALUE_08BIT, OV8856_MODE_STREAMING);
0e014f1a8d546f Bingbu Cao 2021-12-15  1720  	if (ret)
0e014f1a8d546f Bingbu Cao 2021-12-15  1721  		return ret;
0e014f1a8d546f Bingbu Cao 2021-12-15  1722  
0e014f1a8d546f Bingbu Cao 2021-12-15  1723  	ret = ov8856_write_reg(ov8856, OV8856_OTP_MODE_CTRL,
0e014f1a8d546f Bingbu Cao 2021-12-15  1724  			       OV8856_REG_VALUE_08BIT, OV8856_OTP_MODE_AUTO);
0e014f1a8d546f Bingbu Cao 2021-12-15  1725  	if (ret) {
0e014f1a8d546f Bingbu Cao 2021-12-15  1726  		dev_err(&client->dev, "failed to set otp mode");
0e014f1a8d546f Bingbu Cao 2021-12-15  1727  		return ret;
0e014f1a8d546f Bingbu Cao 2021-12-15  1728  	}
0e014f1a8d546f Bingbu Cao 2021-12-15  1729  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp


  reply	other threads:[~2022-05-16 11:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-10 15:12 [PATCH v2] UPSTREAM: media: ov8856: skip OTP read in non-zero ACPI D state Jimmy Su
2022-05-16 11:30 ` Dan Carpenter [this message]
2022-05-18 17:15 ` Sakari Ailus

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=202205131109.giBGpLnO-lkp@intel.com \
    --to=dan.carpenter@oracle.com \
    --cc=akeem.chen@ovt.com \
    --cc=andy.yeh@intel.com \
    --cc=jimmy.su@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=linux-media@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=yhuang@ovt.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox