From: Andrew Morton <akpm@linux-foundation.org>
To: Manfred Spraul <manfred@colorfullife.com>
Cc: kbuild test robot <lkp@intel.com>,
kbuild-all@01.org,
Linux Memory Management List <linux-mm@kvack.org>,
Waiman Long <longman@redhat.com>,
Davidlohr Bueso <dbueso@suse.de>
Subject: Re: [linux-next:master 6345/7161] ipc/util.c:226:13: note: in expansion of macro 'max'
Date: Mon, 15 Apr 2019 13:57:08 -0700 [thread overview]
Message-ID: <20190415135708.0dbc9e3ddb5afeb47bd52ce4@linux-foundation.org> (raw)
In-Reply-To: <e9dc2a8a-6e57-c57a-df1f-678794542d09@colorfullife.com>
On Sun, 14 Apr 2019 20:21:30 +0200 Manfred Spraul <manfred@colorfullife.com> wrote:
>
> With sysctl disabled, ipc_min_cycle is RADIX_TREE_MAP_SIZE, and this is
>
> > include/linux/radix-tree.h:#define RADIX_TREE_MAP_SIZE (1UL <<
> RADIX_TREE_MAP_SHIFT)
>
> The checker behind max() is not smart enough to notice that
> RADIX_TREE_MAP_SIZE can be represented as int without an overflow.
>
>
> What is the right approach?
>
Make ipc_min_cycle have the same type in both cases?
--- a/ipc/util.h~ipc-do-cyclic-id-allocation-for-the-ipc-object-fix
+++ a/ipc/util.h
@@ -42,7 +42,7 @@ extern int ipc_min_cycle;
#else /* CONFIG_SYSVIPC_SYSCTL */
#define ipc_mni IPCMNI
-#define ipc_min_cycle RADIX_TREE_MAP_SIZE
+#define ipc_min_cycle ((int)RADIX_TREE_MAP_SIZE)
#define ipcmni_seq_shift() IPCMNI_SHIFT
#define IPCMNI_IDX_MASK ((1 << IPCMNI_SHIFT) - 1)
#endif /* CONFIG_SYSVIPC_SYSCTL */
_
prev parent reply other threads:[~2019-04-15 20:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-12 18:43 kbuild test robot
2019-04-14 18:21 ` Manfred Spraul
2019-04-15 20:57 ` Andrew Morton [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=20190415135708.0dbc9e3ddb5afeb47bd52ce4@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=dbueso@suse.de \
--cc=kbuild-all@01.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=longman@redhat.com \
--cc=manfred@colorfullife.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