diff mbox series

drivers:watchdog:remove unneeded variable

Message ID 20211209015353.409612-1-chi.minghao@zte.com.cn
State New
Headers show
Series drivers:watchdog:remove unneeded variable | expand

Commit Message

Lv Ruyi Dec. 9, 2021, 1:53 a.m. UTC
From: chiminghao <chi.minghao@zte.com.cn>

return value form directly instead of
taking this in another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cm>
Signed-off-by: chiminghao <chi.minghao@zte.com.cn>
---
 drivers/watchdog/pcwd_pci.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Guenter Roeck Dec. 9, 2021, 3:58 a.m. UTC | #1
On 12/8/21 5:53 PM, cgel.zte@gmail.com wrote:
> From: chiminghao <chi.minghao@zte.com.cn>
> 
> return value form directly instead of
> taking this in another redundant variable.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cm>
> Signed-off-by: chiminghao <chi.minghao@zte.com.cn>

No, this is an old watchdog driver. Functional fixes for those only, please.

Guenter

> ---
>   drivers/watchdog/pcwd_pci.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/watchdog/pcwd_pci.c b/drivers/watchdog/pcwd_pci.c
> index 54d86fcb1837..edbc0f28d399 100644
> --- a/drivers/watchdog/pcwd_pci.c
> +++ b/drivers/watchdog/pcwd_pci.c
> @@ -215,10 +215,7 @@ static inline void pcipcwd_check_temperature_support(void)
>   
>   static int pcipcwd_get_option_switches(void)
>   {
> -	int option_switches;
> -
> -	option_switches = inb_p(pcipcwd_private.io_addr + 3);
> -	return option_switches;
> +	return inb_p(pcipcwd_private.io_addr + 3);
>   }
>   
>   static void pcipcwd_show_card_info(void)
>
diff mbox series

Patch

diff --git a/drivers/watchdog/pcwd_pci.c b/drivers/watchdog/pcwd_pci.c
index 54d86fcb1837..edbc0f28d399 100644
--- a/drivers/watchdog/pcwd_pci.c
+++ b/drivers/watchdog/pcwd_pci.c
@@ -215,10 +215,7 @@  static inline void pcipcwd_check_temperature_support(void)
 
 static int pcipcwd_get_option_switches(void)
 {
-	int option_switches;
-
-	option_switches = inb_p(pcipcwd_private.io_addr + 3);
-	return option_switches;
+	return inb_p(pcipcwd_private.io_addr + 3);
 }
 
 static void pcipcwd_show_card_info(void)