mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: cgel.zte@gmail.com
To: arnd@arndb.de
Cc: linux-kernel@vger.kernel.org,
	Minghao Chi <chi.minghao@zte.com.cn>,
	Zeal Robot <zealci@zte.com.cn>, CGEL ZTE <cgel.zte@gmail.com>
Subject: [PATCH] drivers/misc: remove redundant ret variable
Date: Mon, 10 Jan 2022 01:31:33 +0000	[thread overview]
Message-ID: <20220110013133.644124-1-chi.minghao@zte.com.cn> (raw)

From: Minghao Chi <chi.minghao@zte.com.cn>

Return value from i2c_smbus_write_i2c_block_data() directly instead
of taking this in another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: CGEL ZTE <cgel.zte@gmail.com>
---
 drivers/misc/bh1770glc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/misc/bh1770glc.c b/drivers/misc/bh1770glc.c
index 0581bb9cef2e..d9714b2f8f6e 100644
--- a/drivers/misc/bh1770glc.c
+++ b/drivers/misc/bh1770glc.c
@@ -301,7 +301,6 @@ static int bh1770_lux_update_thresholds(struct bh1770_chip *chip,
 					u16 threshold_hi, u16 threshold_lo)
 {
 	u8 data[4];
-	int ret;
 
 	/* sysfs may call this when the chip is powered off */
 	if (pm_runtime_suspended(&chip->client->dev))
@@ -330,11 +329,10 @@ static int bh1770_lux_update_thresholds(struct bh1770_chip *chip,
 	data[2] = threshold_lo;
 	data[3] = threshold_lo >> 8;
 
-	ret = i2c_smbus_write_i2c_block_data(chip->client,
+	return i2c_smbus_write_i2c_block_data(chip->client,
 					BH1770_ALS_TH_UP_0,
 					ARRAY_SIZE(data),
 					data);
-	return ret;
 }
 
 static int bh1770_lux_get_result(struct bh1770_chip *chip)
-- 
2.25.1


                 reply	other threads:[~2022-01-10  1:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220110013133.644124-1-chi.minghao@zte.com.cn \
    --to=cgel.zte@gmail.com \
    --cc=arnd@arndb.de \
    --cc=chi.minghao@zte.com.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zealci@zte.com.cn \
    /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

all inboxes | Powered by JetHome®