* [PATCH] drivers/hwmon: remove redundant freq variable
@ 2022-01-12 8:26 cgel.zte
2022-01-12 15:44 ` Guenter Roeck
0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-01-12 8:26 UTC (permalink / raw)
To: jdelvare; +Cc: linux-hwmon, linux-kernel, Minghao Chi, Zeal Robot, CGEL ZTE
From: Minghao Chi <chi.minghao@zte.com.cn>
Return value 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/hwmon/w83627hf.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/hwmon/w83627hf.c b/drivers/hwmon/w83627hf.c
index 9be277156ed2..0feb581975cf 100644
--- a/drivers/hwmon/w83627hf.c
+++ b/drivers/hwmon/w83627hf.c
@@ -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)
{
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drivers/hwmon: remove redundant freq variable
2022-01-12 8:26 [PATCH] drivers/hwmon: remove redundant freq variable cgel.zte
@ 2022-01-12 15:44 ` Guenter Roeck
0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2022-01-12 15:44 UTC (permalink / raw)
To: cgel.zte; +Cc: jdelvare, linux-hwmon, linux-kernel, Minghao Chi, Zeal Robot
On Wed, Jan 12, 2022 at 08:26:02AM +0000, cgel.zte@gmail.com wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
>
> 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
> 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/hwmon/w83627hf.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/hwmon/w83627hf.c b/drivers/hwmon/w83627hf.c
> index 9be277156ed2..0feb581975cf 100644
> --- a/drivers/hwmon/w83627hf.c
> +++ b/drivers/hwmon/w83627hf.c
> @@ -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)
> {
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-01-12 15:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-12 8:26 [PATCH] drivers/hwmon: remove redundant freq variable cgel.zte
2022-01-12 15:44 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).