Skip to contentSkip to conversation

drivers/hwmon: remove redundant freq variable

PATCH In review [email protected] 2 participants 2 messages Jan 12, 2022 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/hwmon: remove redundant freq variable

From: Minghao Chi <[email protected]>

Return value directly instead of taking this in another redundant variable.

---
 drivers/hwmon/w83627hf.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/hwmon/w83627hf.c +1 -3
index 9be277156ed2..0feb581975cf 100644
@@ -283,9 +283,7 @@ static int TEMP_FROM_REG(u8 reg)
 
 static inline unsigned long pwm_freq_from_reg_627hf(u8 reg)
 {
-	unsigned long freq;
-	freq = W83627HF_BASE_PWM_FREQ >> reg;
-	return freq;
+	return W83627HF_BASE_PWM_FREQ >> reg;
 }
 static inline u8 pwm_freq_to_reg_627hf(unsigned long val)
 {
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 5 lines · On Wed, Jan 12, 2022 at 08:26:02AM +0000, [email protected] wrote:

From: Minghao Chi <[email protected]>

Return value directly instead of taking this in another redundant variable.

Again, please stop sending me such patches. And, again, the variable is not "redundant" even though there is a partial match in meaning. A better term would be "unnecessary". However, as mentioned before, that is POV because we don't know if the original submitter kept the variable to simplify adding debug code.

Guenter

Quoted 25 lines
---
 drivers/hwmon/w83627hf.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/hwmon/w83627hf.c +1 -3
index 9be277156ed2..0feb581975cf 100644
@@ -283,9 +283,7 @@ static int TEMP_FROM_REG(u8 reg)
 
 static inline unsigned long pwm_freq_from_reg_627hf(u8 reg)
 {
-	unsigned long freq;
-	freq = W83627HF_BASE_PWM_FREQ >> reg;
-	return freq;
+	return W83627HF_BASE_PWM_FREQ >> reg;
 }
 static inline u8 pwm_freq_to_reg_627hf(unsigned long val)
 {
Signature · 1 line
2.25.1