linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pwm: sifive: simplify if-if to if-else
@ 2022-04-08  8:30 Wan Jiabing
  2022-04-08 10:07 ` Uwe Kleine-König
  2022-05-20 13:59 ` Thierry Reding
  0 siblings, 2 replies; 3+ messages in thread
From: Wan Jiabing @ 2022-04-08  8:30 UTC (permalink / raw)
  To: Thierry Reding, Uwe Kleine-König, Lee Jones, Palmer Dabbelt,
	Paul Walmsley, linux-pwm, linux-riscv, linux-kernel
  Cc: Wan Jiabing

use if and else instead of if(A) and if (!A).

Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
---
 drivers/pwm/pwm-sifive.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/pwm/pwm-sifive.c b/drivers/pwm/pwm-sifive.c
index 253c4a17d255..e6d05a329002 100644
--- a/drivers/pwm/pwm-sifive.c
+++ b/drivers/pwm/pwm-sifive.c
@@ -138,10 +138,9 @@ static int pwm_sifive_enable(struct pwm_chip *chip, bool enable)
 			dev_err(ddata->chip.dev, "Enable clk failed\n");
 			return ret;
 		}
-	}
-
-	if (!enable)
+	} else {
 		clk_disable(ddata->clk);
+	}
 
 	return 0;
 }
-- 
2.35.1


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

end of thread, other threads:[~2022-05-20 13:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-08  8:30 [PATCH] pwm: sifive: simplify if-if to if-else Wan Jiabing
2022-04-08 10:07 ` Uwe Kleine-König
2022-05-20 13:59 ` Thierry Reding

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).