Skip to contentSkip to conversation

drivers/misc: remove redundant ret variable

PATCH New [email protected] 1 participant 1 message Jan 10, 2022 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/misc: remove redundant ret variable

From: Minghao Chi <[email protected]>

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

---
 drivers/misc/bh1770glc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/misc/bh1770glc.c +1 -3
index 0581bb9cef2e..d9714b2f8f6e 100644
@@ -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)
Signature · 1 line
2.25.1