Skip to contentSkip to conversation

rtc: s35390a: Remove the unneeded result variable

PATCH Applied [email protected] 2 participants 2 messages Sep 5, 2022 – Nov 14, 2022 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc: s35390a: Remove the unneeded result variable

From: ye xingchen <[email protected]>

Return the value s35390a_set_reg() directly instead of storing it in another redundant variable.

---
 drivers/rtc/rtc-s35390a.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/rtc/rtc-s35390a.c +2 -4
index 81d97b1d3159..b18daaf72b17 100644
@@ -211,7 +211,7 @@ static int s35390a_rtc_set_time(struct device *dev, struct rtc_time *tm)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct s35390a	*s35390a = i2c_get_clientdata(client);
-	int i, err;
+	int i;
 	char buf[7], status;
 
 	dev_dbg(&client->dev, "%s: tm is secs=%d, mins=%d, hours=%d mday=%d, "
@@ -234,9 +234,7 @@ static int s35390a_rtc_set_time(struct device *dev, struct rtc_time *tm)
 	for (i = 0; i < 7; ++i)
 		buf[i] = bitrev8(buf[i]);
 
-	err = s35390a_set_reg(s35390a, S35390A_CMD_TIME1, buf, sizeof(buf));
-
-	return err;
+	return s35390a_set_reg(s35390a, S35390A_CMD_TIME1, buf, sizeof(buf));
 }
 
 static int s35390a_rtc_read_time(struct device *dev, struct rtc_time *tm)
Signature · 1 line
2.25.1
maintainer Applied
#1 lore raw
Quoted 6 lines · On Mon, 5 Sep 2022 09:01:19 +0000, [email protected] wrote:

From: ye xingchen <[email protected]>

Return the value s35390a_set_reg() directly instead of storing it in another redundant variable.

Applied, thanks!

[1/1] rtc: s35390a: Remove the unneeded result variable

      commit: ba9c9a77035907295c542cf343d3cdd85cdc9a9e

Best regards,

Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com