linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Amelie DELAUNAY <amelie.delaunay@st.com>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>,
	Mark Brown <broonie@kernel.org>,
	Alessandro Zummo <a.zummo@towertech.it>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre TORGUE <alexandre.torgue@st.com>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	"rtc-linux@googlegroups.com" <rtc-linux@googlegroups.com>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] rtc: stm32: use 32-bit cast for BIT() macro
Date: Fri, 13 Jan 2017 17:48:49 +0100	[thread overview]
Message-ID: <CAK8P3a3vzwB5MDiVse+meK17KKHtaZWzmOkfzJ2d=n=sgjzkRw@mail.gmail.com> (raw)
In-Reply-To: <26624cbe-7e71-35a4-b8df-f5ac5d15b1ec@st.com>

On Fri, Jan 13, 2017 at 4:56 PM, Amelie DELAUNAY <amelie.delaunay@st.com> wrote:
> On 01/13/2017 04:32 PM, Arnd Bergmann wrote:
>>
>> Using the ~ operator on a BIT() constant results in a large 'unsigned
>> long'
>> constant that won't fit into an 'unsigned int' function argument on 64-bit
>> architectures, resulting in a harmless build warning in x86 allmodconfig:
>>
>> drivers/rtc/rtc-stm32.c: In function 'stm32_rtc_probe':
>> drivers/rtc/rtc-stm32.c:651:51: error: large integer implicitly truncated
>> to unsigned type [-Werror=overflow]
>>   regmap_update_bits(rtc->dbp, PWR_CR, PWR_CR_DBP, ~PWR_CR_DBP);
>
> I thought I would fix this warning by replacing all ~PWR_CR_DBP by 0,
> because the mask PWR_CR_DBP prevents other bits to be cleared.
> In this way, I avoid the ugly cast...

Good idea, much nicer than mine! Can you send that patch?

    Arnd

  reply	other threads:[~2017-01-13 16:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-13 15:32 [PATCH 1/3] rtc: stm32: remove __exit annotation on remove callback Arnd Bergmann
2017-01-13 15:32 ` [PATCH 2/3] rtc: stm32: fix building without CONFIG_OF Arnd Bergmann
2017-01-13 16:55   ` Alexandre Belloni
2017-01-13 15:32 ` [PATCH 3/3] rtc: stm32: use 32-bit cast for BIT() macro Arnd Bergmann
2017-01-13 15:52   ` Russell King - ARM Linux
2017-01-13 15:55     ` Alexandre Belloni
2017-01-13 15:56   ` Amelie DELAUNAY
2017-01-13 16:48     ` Arnd Bergmann [this message]
2017-01-13 16:54 ` [PATCH 1/3] rtc: stm32: remove __exit annotation on remove callback 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='CAK8P3a3vzwB5MDiVse+meK17KKHtaZWzmOkfzJ2d=n=sgjzkRw@mail.gmail.com' \
    --to=arnd@arndb.de \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=alexandre.torgue@st.com \
    --cc=amelie.delaunay@st.com \
    --cc=broonie@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=rtc-linux@googlegroups.com \
    /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).