All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Tianshu Qiu <tian.shu.qiu@intel.com>,
	Shawn Tu <shawnx.tu@intel.com>, Bingbu Cao <bingbu.cao@intel.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Subject: [PATCH v1 5/8] media: ov2740: Drop redundant assignments of ret = 0
Date: Tue, 26 Jul 2022 15:05:53 +0300	[thread overview]
Message-ID: <20220726120556.2881-5-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20220726120556.2881-1-andriy.shevchenko@linux.intel.com>

In some cases it might hide real bugs, in most cases here it's just
redundant as it's being reassigned immediately after initial assignment.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/media/i2c/ov2740.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/media/i2c/ov2740.c b/drivers/media/i2c/ov2740.c
index 07fe8fda274e..212190cb14e4 100644
--- a/drivers/media/i2c/ov2740.c
+++ b/drivers/media/i2c/ov2740.c
@@ -378,7 +378,7 @@ static int ov2740_read_reg(struct ov2740 *ov2740, u16 reg, u16 len, u32 *val)
 	struct i2c_msg msgs[2];
 	u8 addr_buf[2];
 	u8 data_buf[4];
-	int ret = 0;
+	int ret;
 
 	if (len > 4)
 		return -EINVAL;
@@ -415,7 +415,7 @@ static int ov2740_write_reg(struct ov2740 *ov2740, u16 reg, u16 len, u32 val)
 {
 	struct i2c_client *client = v4l2_get_subdevdata(&ov2740->sd);
 	u8 buf[6];
-	int ret = 0;
+	int ret;
 
 	if (len > 4)
 		return -EINVAL;
@@ -444,7 +444,7 @@ static int ov2740_write_reg_list(struct ov2740 *ov2740,
 {
 	struct i2c_client *client = v4l2_get_subdevdata(&ov2740->sd);
 	unsigned int i;
-	int ret = 0;
+	int ret;
 
 	for (i = 0; i < r_list->num_of_regs; i++) {
 		ret = ov2740_write_reg(ov2740, r_list->regs[i].address, 1,
@@ -486,7 +486,7 @@ static int ov2740_identify_module(struct ov2740 *ov2740)
 
 static int ov2740_update_digital_gain(struct ov2740 *ov2740, u32 d_gain)
 {
-	int ret = 0;
+	int ret;
 
 	ret = ov2740_write_reg(ov2740, OV2740_REG_GROUP_ACCESS, 1,
 			       OV2740_GROUP_HOLD_START);
@@ -530,7 +530,7 @@ static int ov2740_set_ctrl(struct v4l2_ctrl *ctrl)
 					     struct ov2740, ctrl_handler);
 	struct i2c_client *client = v4l2_get_subdevdata(&ov2740->sd);
 	s64 exposure_max;
-	int ret = 0;
+	int ret;
 
 	/* Propagate change of current control to all related controls */
 	if (ctrl->id == V4L2_CID_VBLANK) {
@@ -593,7 +593,7 @@ static int ov2740_init_controls(struct ov2740 *ov2740)
 	s64 exposure_max, h_blank, pixel_rate;
 	u32 vblank_min, vblank_max, vblank_default;
 	int size;
-	int ret = 0;
+	int ret;
 
 	ctrl_hdlr = &ov2740->ctrl_handler;
 	ret = v4l2_ctrl_handler_init(ctrl_hdlr, 8);
@@ -759,7 +759,7 @@ static int ov2740_start_streaming(struct ov2740 *ov2740)
 	struct i2c_client *client = v4l2_get_subdevdata(&ov2740->sd);
 	const struct ov2740_reg_list *reg_list;
 	int link_freq_index;
-	int ret = 0;
+	int ret;
 
 	ret = ov2740_identify_module(ov2740);
 	if (ret)
@@ -1154,8 +1154,8 @@ static int ov2740_register_nvmem(struct i2c_client *client,
 static int ov2740_probe(struct i2c_client *client)
 {
 	struct ov2740 *ov2740;
-	int ret = 0;
 	bool full_power;
+	int ret;
 
 	ret = ov2740_check_hwcfg(&client->dev);
 	if (ret) {
-- 
2.35.1


  parent reply	other threads:[~2022-07-26 12:05 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-26 12:05 [PATCH v1 1/8] media: ov2740: Remove duplicative pointer in struct nvm_data Andy Shevchenko
2022-07-26 12:05 ` [PATCH v1 2/8] media: ov2740: Replace voodoo coding with understandle flow Andy Shevchenko
2022-07-27  9:52   ` Cao, Bingbu
2022-11-11 15:02   ` Sakari Ailus
2022-11-11 15:30     ` Andy Shevchenko
2022-11-11 19:46       ` Sakari Ailus
2022-07-26 12:05 ` [PATCH v1 3/8] media: ov2740: Switch from __maybe_unused to pm_sleep_ptr() etc Andy Shevchenko
2022-07-26 12:05 ` [PATCH v1 4/8] media: ov2740: Remove duplicate check for NULL fwnode Andy Shevchenko
2022-07-27  9:41   ` Cao, Bingbu
2022-07-27 10:01   ` Cao, Bingbu
2022-07-26 12:05 ` Andy Shevchenko [this message]
2022-07-26 12:05 ` [PATCH v1 6/8] media: ov2740: Switch to use dev_err_probe() Andy Shevchenko
2022-07-27 10:06   ` Cao, Bingbu
2022-07-26 12:05 ` [PATCH v1 7/8] media: ov2740: Add missed \n to the end of the messages Andy Shevchenko
2022-07-27 10:01   ` Cao, Bingbu
2022-07-26 12:05 ` [PATCH v1 8/8] media: ov2740: Use traditional pattern when checking error codes Andy Shevchenko
2022-08-23 14:10 ` [PATCH v1 1/8] media: ov2740: Remove duplicative pointer in struct nvm_data Andy Shevchenko
2022-11-11 12:05   ` Andy Shevchenko
2022-11-11 12:08     ` Andy Shevchenko
2022-11-11 14:58       ` Sakari Ailus
2022-11-11 15:29         ` Andy Shevchenko
2022-11-11 19:41           ` Sakari Ailus
2022-11-11 19:47             ` Andy Shevchenko

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=20220726120556.2881-5-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=bingbu.cao@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=shawnx.tu@intel.com \
    --cc=tian.shu.qiu@intel.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 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.