linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Nicholas Mc Guire <hofrat@osadl.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
	linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rtc: ds2404: use hw endiannes variable
Date: Thu, 23 May 2019 17:42:44 +0200	[thread overview]
Message-ID: <20190523154244.GU3274@piout.net> (raw)
In-Reply-To: <1557368035-6787-1-git-send-email-hofrat@osadl.org>

On 09/05/2019 04:13:55+0200, Nicholas Mc Guire wrote:
> Converting from hardware to host endiannes was done using reassignment
> to the same variable which makes sparse unhappy as it can not verify
> the endiannes handling properly. To allow sparse to verify endiannes
> handling an explicit __le32 is introduced. Note that this patch does
> not change the generated binary (x86_64 and ppc64 binary diff).
> 
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
> ---
> 
> Problem located by an experimental coccinelle script to locate
> patters that make sparse unhappy (false positives):
> 
> on little-endian x86_64 sparse complains about:
> drivers/rtc/rtc-ds2404.c:187:16: warning: cast to restricted __le32
> on big-endian ppc64 sparse complains about
> drivers/rtc/rtc-ds2404.c:187:16: warning: cast to restricted __le32
> drivers/rtc/rtc-ds2404.c:187:16: warning: cast to restricted __le32
> drivers/rtc/rtc-ds2404.c:187:16: warning: cast to restricted __le32
> drivers/rtc/rtc-ds2404.c:187:16: warning: cast to restricted __le32
> drivers/rtc/rtc-ds2404.c:187:16: warning: cast to restricted __le32
> drivers/rtc/rtc-ds2404.c:187:16: warning: cast to restricted __le32
> 
> Patch was compiletested with:
>  x86_64_defconfig + RTC_DRV_DS2404=m
>  ppc64_defconfig + RTC_DRV_DS2404=m
> 
> in both cases applying the patch has no impact on the generated binary.
> 
> Patch is against 5.1 (localversion-next is next-20190508)
> 
>  drivers/rtc/rtc-ds2404.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
Applied, thanks.

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

      reply	other threads:[~2019-05-23 15:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-09  2:13 [PATCH] rtc: ds2404: use hw endiannes variable Nicholas Mc Guire
2019-05-23 15:42 ` Alexandre Belloni [this message]

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=20190523154244.GU3274@piout.net \
    --to=alexandre.belloni@bootlin.com \
    --cc=a.zummo@towertech.it \
    --cc=hofrat@osadl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).