All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] watchdog: indydog: Simplify indydog_{start,stop}
@ 2014-02-15  9:21 Alexander Shiyan
  2014-02-15 17:44 ` Guenter Roeck
  2014-02-24 19:58 ` Wim Van Sebroeck
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander Shiyan @ 2014-02-15  9:21 UTC (permalink / raw)
  To: linux-watchdog; +Cc: Wim Van Sebroeck, Alexander Shiyan

This patch simplify functions indydog_start() and indydog_stop()
a bit and removes excess intermediate variable.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/watchdog/indydog.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/watchdog/indydog.c b/drivers/watchdog/indydog.c
index 1b5c25a..5d20cdd 100644
--- a/drivers/watchdog/indydog.c
+++ b/drivers/watchdog/indydog.c
@@ -41,24 +41,15 @@ MODULE_PARM_DESC(nowayout,
 
 static void indydog_start(void)
 {
-	u32 mc_ctrl0;
-
 	spin_lock(&indydog_lock);
-	mc_ctrl0 = sgimc->cpuctrl0;
-	mc_ctrl0 = sgimc->cpuctrl0 | SGIMC_CCTRL0_WDOG;
-	sgimc->cpuctrl0 = mc_ctrl0;
+	sgimc->cpuctrl0 |= SGIMC_CCTRL0_WDOG;
 	spin_unlock(&indydog_lock);
 }
 
 static void indydog_stop(void)
 {
-	u32 mc_ctrl0;
-
 	spin_lock(&indydog_lock);
-
-	mc_ctrl0 = sgimc->cpuctrl0;
-	mc_ctrl0 &= ~SGIMC_CCTRL0_WDOG;
-	sgimc->cpuctrl0 = mc_ctrl0;
+	sgimc->cpuctrl0 &= ~SGIMC_CCTRL0_WDOG;
 	spin_unlock(&indydog_lock);
 
 	pr_info("Stopped watchdog timer\n");
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] watchdog: indydog: Simplify indydog_{start,stop}
  2014-02-15  9:21 [PATCH] watchdog: indydog: Simplify indydog_{start,stop} Alexander Shiyan
@ 2014-02-15 17:44 ` Guenter Roeck
  2014-02-24 19:58 ` Wim Van Sebroeck
  1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2014-02-15 17:44 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: linux-watchdog, Wim Van Sebroeck

On Sat, Feb 15, 2014 at 01:21:51PM +0400, Alexander Shiyan wrote:
> This patch simplify functions indydog_start() and indydog_stop()
> a bit and removes excess intermediate variable.
> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/indydog.c | 13 ++-----------
>  1 file changed, 2 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/watchdog/indydog.c b/drivers/watchdog/indydog.c
> index 1b5c25a..5d20cdd 100644
> --- a/drivers/watchdog/indydog.c
> +++ b/drivers/watchdog/indydog.c
> @@ -41,24 +41,15 @@ MODULE_PARM_DESC(nowayout,
>  
>  static void indydog_start(void)
>  {
> -	u32 mc_ctrl0;
> -
>  	spin_lock(&indydog_lock);
> -	mc_ctrl0 = sgimc->cpuctrl0;
> -	mc_ctrl0 = sgimc->cpuctrl0 | SGIMC_CCTRL0_WDOG;
> -	sgimc->cpuctrl0 = mc_ctrl0;
> +	sgimc->cpuctrl0 |= SGIMC_CCTRL0_WDOG;
>  	spin_unlock(&indydog_lock);
>  }
>  
>  static void indydog_stop(void)
>  {
> -	u32 mc_ctrl0;
> -
>  	spin_lock(&indydog_lock);
> -
> -	mc_ctrl0 = sgimc->cpuctrl0;
> -	mc_ctrl0 &= ~SGIMC_CCTRL0_WDOG;
> -	sgimc->cpuctrl0 = mc_ctrl0;
> +	sgimc->cpuctrl0 &= ~SGIMC_CCTRL0_WDOG;
>  	spin_unlock(&indydog_lock);
>  
>  	pr_info("Stopped watchdog timer\n");
> -- 
> 1.8.3.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] watchdog: indydog: Simplify indydog_{start,stop}
  2014-02-15  9:21 [PATCH] watchdog: indydog: Simplify indydog_{start,stop} Alexander Shiyan
  2014-02-15 17:44 ` Guenter Roeck
@ 2014-02-24 19:58 ` Wim Van Sebroeck
  1 sibling, 0 replies; 3+ messages in thread
From: Wim Van Sebroeck @ 2014-02-24 19:58 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: linux-watchdog

Hi Alexander,

> This patch simplify functions indydog_start() and indydog_stop()
> a bit and removes excess intermediate variable.
> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> ---
>  drivers/watchdog/indydog.c | 13 ++-----------
>  1 file changed, 2 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/watchdog/indydog.c b/drivers/watchdog/indydog.c
> index 1b5c25a..5d20cdd 100644
> --- a/drivers/watchdog/indydog.c
> +++ b/drivers/watchdog/indydog.c
> @@ -41,24 +41,15 @@ MODULE_PARM_DESC(nowayout,
>  
>  static void indydog_start(void)
>  {
> -	u32 mc_ctrl0;
> -
>  	spin_lock(&indydog_lock);
> -	mc_ctrl0 = sgimc->cpuctrl0;
> -	mc_ctrl0 = sgimc->cpuctrl0 | SGIMC_CCTRL0_WDOG;
> -	sgimc->cpuctrl0 = mc_ctrl0;
> +	sgimc->cpuctrl0 |= SGIMC_CCTRL0_WDOG;
>  	spin_unlock(&indydog_lock);
>  }
>  
>  static void indydog_stop(void)
>  {
> -	u32 mc_ctrl0;
> -
>  	spin_lock(&indydog_lock);
> -
> -	mc_ctrl0 = sgimc->cpuctrl0;
> -	mc_ctrl0 &= ~SGIMC_CCTRL0_WDOG;
> -	sgimc->cpuctrl0 = mc_ctrl0;
> +	sgimc->cpuctrl0 &= ~SGIMC_CCTRL0_WDOG;
>  	spin_unlock(&indydog_lock);
>  
>  	pr_info("Stopped watchdog timer\n");
> -- 
> 1.8.3.2
> 

This patch has been added to linux-watchdog-next.

Kind regards,
Wim.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-24 19:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-15  9:21 [PATCH] watchdog: indydog: Simplify indydog_{start,stop} Alexander Shiyan
2014-02-15 17:44 ` Guenter Roeck
2014-02-24 19:58 ` Wim Van Sebroeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.