public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: i2c: fix returnvar.cocci warnings
@ 2019-10-03 11:43 Julia Lawall
  0 siblings, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2019-10-03 11:43 UTC (permalink / raw)
  To: Manivannan Sadhasivam
  Cc: mchehab, robh+dt, sakari.ailus, linux-media, linux-kernel,
	devicetree, linux-arm-kernel, c.barrett, a.brela,
	Manivannan Sadhasivam, kbuild-all

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

Remove unneeded variable used to store return value.

Generated by: scripts/coccinelle/misc/returnvar.cocci

Fixes: a80daf4057d7 ("media: i2c: Add IMX290 CMOS image sensor driver")
CC: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
---

url:    https://github.com/0day-ci/linux/commits/Manivannan-Sadhasivam/dt-bindings-media-i2c-Add-IMX290-CMOS-sensor-binding/20191003-175652
base:   git://linuxtv.org/media_tree.git master
:::::: branch date: 2 hours ago
:::::: commit date: 2 hours ago

Please take the patch only if it's a positive warning. Thanks!

 imx290.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/media/i2c/imx290.c
+++ b/drivers/media/i2c/imx290.c
@@ -447,7 +447,6 @@ static int imx290_set_fmt(struct v4l2_su
 	const struct imx290_mode *mode;
 	struct v4l2_mbus_framefmt *format;
 	unsigned int i;
-	int ret = 0;

 	mutex_lock(&imx290->lock);

@@ -483,7 +482,7 @@ static int imx290_set_fmt(struct v4l2_su

 	mutex_unlock(&imx290->lock);

-	return ret;
+	return 0;
 }

 static int imx290_entity_init_cfg(struct v4l2_subdev *subdev,

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] media: i2c: fix boolconv.cocci warnings
  2022-01-19  5:26 drivers/media/i2c/ov5693.c:989:46-51: WARNING: conversion to bool not needed here kernel test robot
@ 2022-01-19  5:24 ` kernel test robot
  2022-01-19  5:24 ` [PATCH] media: i2c: fix returnvar.cocci warnings kernel test robot
  1 sibling, 0 replies; 4+ messages in thread
From: kernel test robot @ 2022-01-19  5:24 UTC (permalink / raw)
  To: Daniel Scally
  Cc: kbuild-all, linux-kernel, Mauro Carvalho Chehab, linux-media,
	Jean-Michel Hautbois, Sakari Ailus

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

drivers/media/i2c/ov5693.c:989:46-51: WARNING: conversion to bool not needed here
drivers/media/i2c/ov5693.c:991:46-51: WARNING: conversion to bool not needed here

 Remove unneeded conversion to bool

Semantic patch information:
 Relational and logical operators evaluate to bool,
 explicit conversion is overly verbose and unneeded.

Generated by: scripts/coccinelle/misc/boolconv.cocci

CC: Daniel Scally <djrscally@gmail.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   99613159ad749543621da8238acf1a122880144e
commit: 89aef879cb537061f7a0948210fc00c5f1b5dfb4 media: i2c: Add support for ov5693 sensor
:::::: branch date: 17 hours ago
:::::: commit date: 7 weeks ago

 ov5693.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/media/i2c/ov5693.c
+++ b/drivers/media/i2c/ov5693.c
@@ -986,9 +986,9 @@ static int ov5693_set_fmt(struct v4l2_su
 
 	mutex_lock(&ov5693->lock);
 
-	ov5693->mode.binning_x = hratio > 1 ? true : false;
+	ov5693->mode.binning_x = hratio > 1;
 	ov5693->mode.inc_x_odd = hratio > 1 ? 3 : 1;
-	ov5693->mode.binning_y = vratio > 1 ? true : false;
+	ov5693->mode.binning_y = vratio > 1;
 	ov5693->mode.inc_y_odd = vratio > 1 ? 3 : 1;
 
 	ov5693->mode.vts = __ov5693_calc_vts(fmt->height);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] media: i2c: fix returnvar.cocci warnings
  2022-01-19  5:26 drivers/media/i2c/ov5693.c:989:46-51: WARNING: conversion to bool not needed here kernel test robot
  2022-01-19  5:24 ` [PATCH] media: i2c: fix boolconv.cocci warnings kernel test robot
@ 2022-01-19  5:24 ` kernel test robot
  1 sibling, 0 replies; 4+ messages in thread
From: kernel test robot @ 2022-01-19  5:24 UTC (permalink / raw)
  To: Daniel Scally
  Cc: kbuild-all, linux-kernel, Mauro Carvalho Chehab, linux-media,
	Jean-Michel Hautbois, Sakari Ailus

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

drivers/media/i2c/ov5693.c:953:5-8: Unneeded variable: "ret". Return "0" on line 985


 Remove unneeded variable used to store return value.

Generated by: scripts/coccinelle/misc/returnvar.cocci

CC: Daniel Scally <djrscally@gmail.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   99613159ad749543621da8238acf1a122880144e
commit: 89aef879cb537061f7a0948210fc00c5f1b5dfb4 media: i2c: Add support for ov5693 sensor
:::::: branch date: 17 hours ago
:::::: commit date: 7 weeks ago

 ov5693.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- a/drivers/media/i2c/ov5693.c
+++ b/drivers/media/i2c/ov5693.c
@@ -950,7 +950,6 @@ static int ov5693_set_fmt(struct v4l2_su
 	unsigned int width, height;
 	unsigned int hblank;
 	int exposure_max;
-	int ret = 0;
 
 	crop = __ov5693_get_pad_crop(ov5693, state, format->pad, format->which);
 
@@ -982,7 +981,7 @@ static int ov5693_set_fmt(struct v4l2_su
 	format->format = *fmt;
 
 	if (format->which == V4L2_SUBDEV_FORMAT_TRY)
-		return ret;
+		return 0;
 
 	mutex_lock(&ov5693->lock);
 
@@ -1012,7 +1011,7 @@ static int ov5693_set_fmt(struct v4l2_su
 				     exposure_max));
 
 	mutex_unlock(&ov5693->lock);
-	return ret;
+	return 0;
 }
 
 static int ov5693_get_selection(struct v4l2_subdev *sd,

^ permalink raw reply	[flat|nested] 4+ messages in thread

* drivers/media/i2c/ov5693.c:989:46-51: WARNING: conversion to bool not needed here
@ 2022-01-19  5:26 kernel test robot
  2022-01-19  5:24 ` [PATCH] media: i2c: fix boolconv.cocci warnings kernel test robot
  2022-01-19  5:24 ` [PATCH] media: i2c: fix returnvar.cocci warnings kernel test robot
  0 siblings, 2 replies; 4+ messages in thread
From: kernel test robot @ 2022-01-19  5:26 UTC (permalink / raw)
  To: Daniel Scally
  Cc: kbuild-all, linux-kernel, Mauro Carvalho Chehab, linux-media,
	Jean-Michel Hautbois, Sakari Ailus

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   99613159ad749543621da8238acf1a122880144e
commit: 89aef879cb537061f7a0948210fc00c5f1b5dfb4 media: i2c: Add support for ov5693 sensor
date:   7 weeks ago
config: arm64-randconfig-c004-20220117 (https://download.01.org/0day-ci/archive/20220119/202201191326.BbZWNNQm-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 11.2.0

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


cocci warnings: (new ones prefixed by >>)
>> drivers/media/i2c/ov5693.c:989:46-51: WARNING: conversion to bool not needed here
   drivers/media/i2c/ov5693.c:991:46-51: WARNING: conversion to bool not needed here
--
>> drivers/media/i2c/ov5693.c:953:5-8: Unneeded variable: "ret". Return "0" on line 985

Please review and possibly fold the followup patch.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-19  5:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-19  5:26 drivers/media/i2c/ov5693.c:989:46-51: WARNING: conversion to bool not needed here kernel test robot
2022-01-19  5:24 ` [PATCH] media: i2c: fix boolconv.cocci warnings kernel test robot
2022-01-19  5:24 ` [PATCH] media: i2c: fix returnvar.cocci warnings kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2019-10-03 11:43 Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox