* [PATCH] drivers/misc: remove redundant ret variable
@ 2022-01-10 1:31 cgel.zte
0 siblings, 0 replies; only message in thread
From: cgel.zte @ 2022-01-10 1:31 UTC (permalink / raw)
To: arnd; +Cc: linux-kernel, Minghao Chi, Zeal Robot, CGEL ZTE
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-01-10 1:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-10 1:31 [PATCH] drivers/misc: remove redundant ret variable cgel.zte
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®