All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rtc: at91sam9: Remove unnecessary offset variable checks
@ 2021-07-08  5:13 Nobuhiro Iwamatsu
  2021-07-08 12:49 ` Nicolas Ferre
  2021-07-10  0:42 ` Alexandre Belloni
  0 siblings, 2 replies; 3+ messages in thread
From: Nobuhiro Iwamatsu @ 2021-07-08  5:13 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, Nobuhiro Iwamatsu, Nicolas Ferre, Ludovic Desroches

The offset variable is checked by at91_rtc_readalarm(), but this check
is unnecessary because the previous check knew that the value of this
variable was not 0.
This removes that unnecessary offset variable checks.

Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
---
 drivers/rtc/rtc-at91sam9.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c
index 2216be429ab727..b7b5ea1a4e6726 100644
--- a/drivers/rtc/rtc-at91sam9.c
+++ b/drivers/rtc/rtc-at91sam9.c
@@ -184,7 +184,7 @@ static int at91_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm)
 		return -EILSEQ;
 
 	memset(alrm, 0, sizeof(*alrm));
-	if (alarm != ALARM_DISABLED && offset != 0) {
+	if (alarm != ALARM_DISABLED) {
 		rtc_time64_to_tm(offset + alarm, tm);
 
 		dev_dbg(dev, "%s: %ptR\n", __func__, tm);
-- 
2.31.1


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

* Re: [PATCH] rtc: at91sam9: Remove unnecessary offset variable checks
  2021-07-08  5:13 [PATCH] rtc: at91sam9: Remove unnecessary offset variable checks Nobuhiro Iwamatsu
@ 2021-07-08 12:49 ` Nicolas Ferre
  2021-07-10  0:42 ` Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Ferre @ 2021-07-08 12:49 UTC (permalink / raw)
  To: Nobuhiro Iwamatsu, Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, Ludovic Desroches

On 08/07/2021 at 07:13, Nobuhiro Iwamatsu wrote:
> The offset variable is checked by at91_rtc_readalarm(), but this check
> is unnecessary because the previous check knew that the value of this
> variable was not 0.
> This removes that unnecessary offset variable checks.
> 
> Cc: Nicolas Ferre <nicolas.ferre@microchip.com>

Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>

> Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
> ---
>   drivers/rtc/rtc-at91sam9.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c
> index 2216be429ab727..b7b5ea1a4e6726 100644
> --- a/drivers/rtc/rtc-at91sam9.c
> +++ b/drivers/rtc/rtc-at91sam9.c
> @@ -184,7 +184,7 @@ static int at91_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm)
>                  return -EILSEQ;
> 
>          memset(alrm, 0, sizeof(*alrm));
> -       if (alarm != ALARM_DISABLED && offset != 0) {
> +       if (alarm != ALARM_DISABLED) {
>                  rtc_time64_to_tm(offset + alarm, tm);
> 
>                  dev_dbg(dev, "%s: %ptR\n", __func__, tm);
> --
> 2.31.1
> 


-- 
Nicolas Ferre

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

* Re: [PATCH] rtc: at91sam9: Remove unnecessary offset variable checks
  2021-07-08  5:13 [PATCH] rtc: at91sam9: Remove unnecessary offset variable checks Nobuhiro Iwamatsu
  2021-07-08 12:49 ` Nicolas Ferre
@ 2021-07-10  0:42 ` Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2021-07-10  0:42 UTC (permalink / raw)
  To: Nobuhiro Iwamatsu, Alessandro Zummo
  Cc: Alexandre Belloni, linux-rtc, Ludovic Desroches, Nicolas Ferre

On Thu, 8 Jul 2021 14:13:40 +0900, Nobuhiro Iwamatsu wrote:
> The offset variable is checked by at91_rtc_readalarm(), but this check
> is unnecessary because the previous check knew that the value of this
> variable was not 0.
> This removes that unnecessary offset variable checks.

Applied, thanks!

[1/1] rtc: at91sam9: Remove unnecessary offset variable checks
      commit: 37aadf9b2a7ea64a358ea7532d7f477fe6837ef1

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

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

end of thread, other threads:[~2021-07-10  0:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-08  5:13 [PATCH] rtc: at91sam9: Remove unnecessary offset variable checks Nobuhiro Iwamatsu
2021-07-08 12:49 ` Nicolas Ferre
2021-07-10  0:42 ` Alexandre Belloni

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.