linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Manfred Spraul <manfred@colorfullife.com>
Cc: kbuild-all@01.org, Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: [linux-next:master 6345/7161] ipc/util.c:226:13: note: in expansion of macro 'max'
Date: Sat, 13 Apr 2019 02:43:53 +0800	[thread overview]
Message-ID: <201904130252.Ws2iLv7w%lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3849 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   bcb67f0fbce97425c5fae5109ffc44c5ddaf96ba
commit: 9b9607c0c01d45bbb0011bad9c6fefe4ab9df1d2 [6345/7161] ipc: do cyclic id allocation for the ipc object.
config: m68k-amcore_defconfig (attached as .config)
compiler: m68k-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 9b9607c0c01d45bbb0011bad9c6fefe4ab9df1d2
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=m68k 

All warnings (new ones prefixed by >>):

   In file included from include/asm-generic/bug.h:18:0,
                    from arch/m68k/include/asm/bug.h:32,
                    from include/linux/bug.h:5,
                    from include/linux/mmdebug.h:5,
                    from include/linux/mm.h:9,
                    from ipc/util.c:47:
   ipc/util.c: In function 'ipc_idr_alloc':
   include/linux/kernel.h:828:29: warning: comparison of distinct pointer types lacks a cast
      (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
                                ^
   include/linux/kernel.h:842:4: note: in expansion of macro '__typecheck'
      (__typecheck(x, y) && __no_side_effects(x, y))
       ^~~~~~~~~~~
   include/linux/kernel.h:852:24: note: in expansion of macro '__safe_cmp'
     __builtin_choose_expr(__safe_cmp(x, y), \
                           ^~~~~~~~~~
   include/linux/kernel.h:868:19: note: in expansion of macro '__careful_cmp'
    #define max(x, y) __careful_cmp(x, y, >)
                      ^~~~~~~~~~~~~
>> ipc/util.c:226:13: note: in expansion of macro 'max'
      max_idx = max(ids->in_use*3/2, ipc_min_cycle);
                ^~~

vim +/max +226 ipc/util.c

   210	
   211		/*
   212		 * As soon as a new object is inserted into the idr,
   213		 * ipc_obtain_object_idr() or ipc_obtain_object_check() can find it,
   214		 * and the lockless preparations for ipc operations can start.
   215		 * This means especially: permission checks, audit calls, allocation
   216		 * of undo structures, ...
   217		 *
   218		 * Thus the object must be fully initialized, and if something fails,
   219		 * then the full tear-down sequence must be followed.
   220		 * (i.e.: set new->deleted, reduce refcount, call_rcu())
   221		 */
   222	
   223		if (next_id < 0) { /* !CHECKPOINT_RESTORE or next_id is unset */
   224			int max_idx;
   225	
 > 226			max_idx = max(ids->in_use*3/2, ipc_min_cycle);
   227			max_idx = min(max_idx, ipc_mni);
   228	
   229			/* allocate the idx, with a NULL struct kern_ipc_perm */
   230			idx = idr_alloc_cyclic(&ids->ipcs_idr, NULL, 0, max_idx,
   231						GFP_NOWAIT);
   232	
   233			if (idx >= 0) {
   234				/*
   235				 * idx got allocated successfully.
   236				 * Now calculate the sequence number and set the
   237				 * pointer for real.
   238				 */
   239				if (idx <= ids->last_idx) {
   240					ids->seq++;
   241					if (ids->seq >= ipcid_seq_max())
   242						ids->seq = 0;
   243				}
   244				ids->last_idx = idx;
   245	
   246				new->seq = ids->seq;
   247				/* no need for smp_wmb(), this is done
   248				 * inside idr_replace, as part of
   249				 * rcu_assign_pointer
   250				 */
   251				idr_replace(&ids->ipcs_idr, new, idx);
   252			}
   253		} else {
   254			new->seq = ipcid_to_seqx(next_id);
   255			idx = idr_alloc(&ids->ipcs_idr, new, ipcid_to_idx(next_id),
   256					0, GFP_NOWAIT);
   257		}
   258		if (idx >= 0)
   259			new->id = (new->seq << ipcmni_seq_shift()) + idx;
   260		return idx;
   261	}
   262	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 9280 bytes --]

             reply	other threads:[~2019-04-12 18:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-12 18:43 kbuild test robot [this message]
2019-04-14 18:21 ` Manfred Spraul
2019-04-15 20:57   ` Andrew Morton

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=201904130252.Ws2iLv7w%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=kbuild-all@01.org \
    --cc=linux-mm@kvack.org \
    --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