linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Chuhong Yuan <hslester96@gmail.com>
Cc: kbuild-all@lists.01.org, linux-media@vger.kernel.org,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Kukjin Kim <kgene@kernel.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org
Subject: [PATCH] media: exynos4-is: fix ptr_ret.cocci warnings
Date: Sun, 19 Jul 2020 21:49:07 +0800	[thread overview]
Message-ID: <20200719134907.GA16381@c288844b3313> (raw)
In-Reply-To: <202007192158.9kUQhoax%lkp@intel.com>

From: kernel test robot <lkp@intel.com>

drivers/media/platform/exynos4-is/media-dev.c:1273:1-3: WARNING: PTR_ERR_OR_ZERO can be used


 Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: scripts/coccinelle/api/ptr_ret.cocci

Fixes: 18ffec750578 ("media: exynos4-is: Add missed check for pinctrl_lookup_state()")
CC: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   git://linuxtv.org/media_tree.git master
head:   8f2a4a9d5ff5202d0b3e3a144ebb9b67aabadd29
commit: 18ffec750578f7447c288647d7282c7d12b1d969 [119/306] media: exynos4-is: Add missed check for pinctrl_lookup_state()

 media-dev.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/media/platform/exynos4-is/media-dev.c
+++ b/drivers/media/platform/exynos4-is/media-dev.c
@@ -1270,10 +1270,7 @@ static int fimc_md_get_pinctrl(struct fi
 
 	pctl->state_idle = pinctrl_lookup_state(pctl->pinctrl,
 					PINCTRL_STATE_IDLE);
-	if (IS_ERR(pctl->state_idle))
-		return PTR_ERR(pctl->state_idle);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(pctl->state_idle);
 }
 
 static int cam_clk_prepare(struct clk_hw *hw)

  reply	other threads:[~2020-07-19 13:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-19 13:49 [linuxtv-media:master 119/306] drivers/media/platform/exynos4-is/media-dev.c:1273:1-3: WARNING: PTR_ERR_OR_ZERO can be used kernel test robot
2020-07-19 13:49 ` kernel test robot [this message]
2020-08-10  9:35   ` [PATCH] media: exynos4-is: fix ptr_ret.cocci warnings Sylwester Nawrocki

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=20200719134907.GA16381@c288844b3313 \
    --to=lkp@intel.com \
    --cc=hslester96@gmail.com \
    --cc=hverkuil@xs4all.nl \
    --cc=kbuild-all@lists.01.org \
    --cc=kgene@kernel.org \
    --cc=krzk@kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=s.nawrocki@samsung.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;
as well as URLs for NNTP newsgroup(s).