devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, kholk11@gmail.com, mchehab@kernel.org
Cc: lkp@intel.com, kbuild-all@lists.01.org, robh+dt@kernel.org,
	marijns95@gmail.com, konradybcio@gmail.com,
	martin.botka1@gmail.com, devicetree@vger.kernel.org,
	linux-media@vger.kernel.org, phone-devel@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	AngeloGioacchino Del Regno <kholk11@gmail.com>
Subject: Re: [PATCH 1/2] media: i2c: Add driver for the Sony Exmor-RS IMX300 camera sensor
Date: Mon, 26 Oct 2020 11:57:47 +0300	[thread overview]
Message-ID: <20201026085747.GD1042@kadam> (raw)
In-Reply-To: <20201018123106.14917-2-kholk11@gmail.com>

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

Hi,

url:    https://github.com/0day-ci/linux/commits/kholk11-gmail-com/Add-support-for-the-Sony-Exmor-RS-IMX300-camera-sensor/20201018-203244
base:   git://linuxtv.org/media_tree.git master
config: x86_64-randconfig-m001-20201022 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.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/imx300.c:2413 imx300_set_framefmt() error: uninitialized symbol 'ret'.

vim +/ret +2413 drivers/media/i2c/imx300.c

c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2377  static int imx300_set_framefmt(struct imx300 *imx300)
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2378  {
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2379  	int ret;
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2380  
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2381  	switch (imx300->fmt.code) {
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2382  	case MEDIA_BUS_FMT_SRGGB8_1X8:
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2383  		fallthrough;
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2384  	case MEDIA_BUS_FMT_SGRBG8_1X8:
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2385  		fallthrough;
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2386  	case MEDIA_BUS_FMT_SGBRG8_1X8:
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2387  		fallthrough;

These fallthrough annotations are not required.

c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2388  	case MEDIA_BUS_FMT_SBGGR8_1X8:
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2389  		ret = imx300_write_regs(imx300, raw8_framefmt_regs,
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2390  					ARRAY_SIZE(raw8_framefmt_regs));
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2391  		if (ret)
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2392  			return ret;
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2393  		imx300->cur_bps = 8;
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2394  		break;
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2395  	case MEDIA_BUS_FMT_SRGGB10_1X10:
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2396  		fallthrough;
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2397  	case MEDIA_BUS_FMT_SGRBG10_1X10:
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2398  		fallthrough;
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2399  	case MEDIA_BUS_FMT_SGBRG10_1X10:
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2400  		fallthrough;

It would look a lot nicer with the annotations removed.  Fall through
is assumed with an empty label.

c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2401  	case MEDIA_BUS_FMT_SBGGR10_1X10:
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2402  		ret = imx300_write_regs(imx300, raw10_framefmt_regs,
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2403  					ARRAY_SIZE(raw10_framefmt_regs));
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2404  		if (ret)
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2405  			return ret;
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2406  		imx300->cur_bps = 10;
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2407  		break;

No default case.

c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2408  	}
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2409  
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2410  	/* Update the pixel rate to eventually save some power */
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2411  	__v4l2_ctrl_s_ctrl_int64(imx300->pixel_rate, get_pixel_rate(imx300));
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2412  
c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18 @2413  	return ret;

Just "return 0;"  It's more readable to return a literal.

c82629fb21ade4 AngeloGioacchino Del Regno 2020-10-18  2414  }

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 36018 bytes --]

  reply	other threads:[~2020-10-26  8:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-18 12:31 [PATCH 0/2] Add support for the Sony Exmor-RS IMX300 camera sensor kholk11
2020-10-18 12:31 ` [PATCH 1/2] media: i2c: Add driver " kholk11
2020-10-26  8:57   ` Dan Carpenter [this message]
2020-10-18 12:31 ` [PATCH 2/2] media: dt-bindings: media: i2c: Add IMX300 CMOS sensor binding kholk11
2020-10-19 16:26   ` Krzysztof Kozlowski
2020-10-26 13:33   ` Rob Herring

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=20201026085747.GD1042@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=kholk11@gmail.com \
    --cc=konradybcio@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=marijns95@gmail.com \
    --cc=martin.botka1@gmail.com \
    --cc=mchehab@kernel.org \
    --cc=phone-devel@vger.kernel.org \
    --cc=robh+dt@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).