linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtc: sc27xx: Remove unnecessary conversion to bool
@ 2020-11-06  7:30 xiakaixu1987
  2020-11-14 22:30 ` Alexandre Belloni
  0 siblings, 1 reply; 2+ messages in thread
From: xiakaixu1987 @ 2020-11-06  7:30 UTC (permalink / raw)
  To: a.zummo, alexandre.belloni; +Cc: linux-rtc, linux-kernel, Kaixu Xia

From: Kaixu Xia <kaixuxia@tencent.com>

Here we could use the '!=' expression to fix the following coccicheck
warning:

./drivers/rtc/rtc-sc27xx.c:566:50-55: WARNING: conversion to bool not needed here

Reported-by: Tosk Robot <tencent_os_robot@tencent.com>
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
---
 drivers/rtc/rtc-sc27xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-sc27xx.c b/drivers/rtc/rtc-sc27xx.c
index 36810dd40cd3..6e65f68ea86d 100644
--- a/drivers/rtc/rtc-sc27xx.c
+++ b/drivers/rtc/rtc-sc27xx.c
@@ -563,7 +563,7 @@ static int sprd_rtc_check_power_down(struct sprd_rtc *rtc)
 	 * means the RTC has been powered down, so the RTC time values are
 	 * invalid.
 	 */
-	rtc->valid = val == SPRD_RTC_POWER_RESET_VALUE ? false : true;
+	rtc->valid = val != SPRD_RTC_POWER_RESET_VALUE;
 	return 0;
 }
 
-- 
2.20.0


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

* Re: [PATCH] rtc: sc27xx: Remove unnecessary conversion to bool
  2020-11-06  7:30 [PATCH] rtc: sc27xx: Remove unnecessary conversion to bool xiakaixu1987
@ 2020-11-14 22:30 ` Alexandre Belloni
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2020-11-14 22:30 UTC (permalink / raw)
  To: a.zummo, xiakaixu1987
  Cc: Alexandre Belloni, linux-rtc, linux-kernel, Kaixu Xia

On Fri, 6 Nov 2020 15:30:54 +0800, xiakaixu1987@gmail.com wrote:
> Here we could use the '!=' expression to fix the following coccicheck
> warning:
> 
> ./drivers/rtc/rtc-sc27xx.c:566:50-55: WARNING: conversion to bool not needed here

Applied, thanks!

[1/1] rtc: sc27xx: Remove unnecessary conversion to bool
      commit: 825156a5eeded9bcb55e9c36d4b4b72bf20bcba6

Best regards,
-- 
Alexandre Belloni <alexandre.belloni@bootlin.com>

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

end of thread, other threads:[~2020-11-14 22:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-06  7:30 [PATCH] rtc: sc27xx: Remove unnecessary conversion to bool xiakaixu1987
2020-11-14 22:30 ` Alexandre Belloni

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