From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756151AbdEOEA5 (ORCPT ); Mon, 15 May 2017 00:00:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50622 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750772AbdEOEAz (ORCPT ); Mon, 15 May 2017 00:00:55 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com EF46983F45 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=xpang@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com EF46983F45 Reply-To: xlpang@redhat.com Subject: Re: linux-next: build warning after merge of the akpm-current tree References: <20170515115602.30e05989@canb.auug.org.au> To: Stephen Rothwell , Andrew Morton Cc: Linux-Next Mailing List , Linux Kernel Mailing List , Xunlei Pang From: Xunlei Pang Message-ID: <5919284A.4050202@redhat.com> Date: Mon, 15 May 2017 12:02:18 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20170515115602.30e05989@canb.auug.org.au> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 15 May 2017 04:00:55 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/15/2017 at 09:56 AM, Stephen Rothwell wrote: > Hi Andrew, > > After merging the akpm-current tree, today's linux-next build (arm > multi_v7_defconfig) produced this warning: > > In file included from include/asm-generic/bug.h:15:0, > from arch/arm/include/asm/bug.h:59, > from include/linux/bug.h:4, > from include/linux/elfcore.h:5, > from include/linux/crash_core.h:5, > from kernel/crash_core.c:9: > kernel/crash_core.c: In function 'vmcoreinfo_append_str': > include/linux/kernel.h:757:16: warning: comparison of distinct pointer types lacks a cast > (void) (&min1 == &min2); \ > ^ > include/linux/kernel.h:760:2: note: in expansion of macro '__min' > __min(typeof(x), typeof(y), \ > ^ > kernel/crash_core.c:360:6: note: in expansion of macro 'min' > r = min(r, VMCOREINFO_BYTES - vmcoreinfo_size); > ^ > > Introduced by commit > > fc7d2b44367f ("powerpc/fadump: use the correct VMCOREINFO_NOTE_SIZE for phdr") > Hi Stephen/Andrew, Sorry for the trouble. The following patch will fix it, do you want to me to send it out separately? or help merge it into fc7d2b44367f ("powerpc/fadump: use the correct VMCOREINFO_NOTE_SIZE for phdr") directly? Thanks, Xunlei =========================================== From: Xunlei Pang Subject: [PATCH] crash: Fix build warning linux-next build (arm multi_v7_defconfig) produced this warning: In file included from include/asm-generic/bug.h:15:0, from arch/arm/include/asm/bug.h:59, from include/linux/bug.h:4, from include/linux/elfcore.h:5, from include/linux/crash_core.h:5, from kernel/crash_core.c:9: kernel/crash_core.c: In function 'vmcoreinfo_append_str': include/linux/kernel.h:757:16: warning: comparison of distinct pointer types lacks a cast (void) (&min1 == &min2); \ ^ include/linux/kernel.h:760:2: note: in expansion of macro '__min' __min(typeof(x), typeof(y), \ ^ kernel/crash_core.c:360:6: note: in expansion of macro 'min' r = min(r, VMCOREINFO_BYTES - vmcoreinfo_size); ^ This patch fixes it. Signed-off-by: Xunlei Pang --- kernel/crash_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/crash_core.c b/kernel/crash_core.c index 4a4a4ba..6db80fc 100644 --- a/kernel/crash_core.c +++ b/kernel/crash_core.c @@ -357,7 +357,7 @@ void vmcoreinfo_append_str(const char *fmt, ...) r = vscnprintf(buf, sizeof(buf), fmt, args); va_end(args); - r = min(r, VMCOREINFO_BYTES - vmcoreinfo_size); + r = min(r, (size_t)VMCOREINFO_BYTES - vmcoreinfo_size); memcpy(&vmcoreinfo_data[vmcoreinfo_size], buf, r); -- 1.8.3.1