From: Rob Herring <robh@kernel.org>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Frank Rowand <frowand.list@gmail.com>,
Grant Likely <grant.likely@linaro.org>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Jason Liu <r64343@freescale.com>
Subject: Re: [PATCH] of: silence warnings due to max() usage
Date: Fri, 3 Jun 2016 07:27:20 -0500 [thread overview]
Message-ID: <20160603122720.GC8472@rob-hp-laptop> (raw)
In-Reply-To: <20160531093856.75c0b04d@canb.auug.org.au>
On Tue, May 31, 2016 at 09:38:56AM +1000, Stephen Rothwell wrote:
> pageblock_order can be (at least) an unsigned int or an unsigned long
> depending on the kernel config and architecture, so use max_t(unsigned
> long ...) when comparing it.
>
> fixes these warnings:
>
> In file included from include/linux/list.h:8:0,
> from include/linux/kobject.h:20,
> from include/linux/of.h:21,
> from drivers/of/of_reserved_mem.c:17:
> drivers/of/of_reserved_mem.c: In function ‘__reserved_mem_alloc_size’:
> include/linux/kernel.h:748:17: warning: comparison of distinct pointer types lacks a cast
> (void) (&_max1 == &_max2); \
> ^
> include/linux/kernel.h:747:9: note: in definition of macro ‘max’
> typeof(y) _max2 = (y); \
> ^
> drivers/of/of_reserved_mem.c:131:48: note: in expansion of macro ‘max’
> align = max(align, (phys_addr_t)PAGE_SIZE << max(MAX_ORDER - 1, pageblock_ord
> ^
> include/linux/kernel.h:748:17: warning: comparison of distinct pointer types lacks a cast
> (void) (&_max1 == &_max2); \
> ^
> include/linux/kernel.h:747:21: note: in definition of macro ‘max’
> typeof(y) _max2 = (y); \
> ^
> drivers/of/of_reserved_mem.c:131:48: note: in expansion of macro ‘max’
> align = max(align, (phys_addr_t)PAGE_SIZE << max(MAX_ORDER - 1, pageblock_ord
> ^
>
> Fixes: 1cc8e3458b51 ("drivers: of: of_reserved_mem: fixup the alignment with CMA setup")
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
> drivers/of/of_reserved_mem.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> Hi guys, this has been irking me for some time now ... I will add this
> to my fixes tree in linux-next today. Please apply and send to Linus.
Applied, thanks.
Rob
prev parent reply other threads:[~2016-06-03 12:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-30 23:38 [PATCH] of: silence warnings due to max() usage Stephen Rothwell
2016-06-03 12:27 ` Rob Herring [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=20160603122720.GC8472@rob-hp-laptop \
--to=robh@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=grant.likely@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=r64343@freescale.com \
--cc=sfr@canb.auug.org.au \
/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