From: Nicolas Ferre <nicolas.ferre@microchip.com>
To: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>,
Alessandro Zummo <a.zummo@towertech.it>,
Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: <linux-rtc@vger.kernel.org>,
Ludovic Desroches <ludovic.desroches@microchip.com>
Subject: Re: [PATCH] rtc: at91sam9: Remove unnecessary offset variable checks
Date: Thu, 8 Jul 2021 14:49:46 +0200 [thread overview]
Message-ID: <ad2606b2-d1b4-7fc9-ed4c-077e31a34aa1@microchip.com> (raw)
In-Reply-To: <20210708051340.341345-1-nobuhiro1.iwamatsu@toshiba.co.jp>
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
next prev parent reply other threads:[~2021-07-08 12:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-08 5:13 [PATCH] rtc: at91sam9: Remove unnecessary offset variable checks Nobuhiro Iwamatsu
2021-07-08 12:49 ` Nicolas Ferre [this message]
2021-07-10 0:42 ` Alexandre Belloni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ad2606b2-d1b4-7fc9-ed4c-077e31a34aa1@microchip.com \
--to=nicolas.ferre@microchip.com \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@bootlin.com \
--cc=linux-rtc@vger.kernel.org \
--cc=ludovic.desroches@microchip.com \
--cc=nobuhiro1.iwamatsu@toshiba.co.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox