Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1641243 > unrolled thread

linux-next: build warning after merge of the akpm-current tree

Started byStephen Rothwell <sfr@canb.auug.org.au>
First post2017-05-15 04:00 +0200
Last post2017-05-15 07:10 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  linux-next: build warning after merge of the akpm-current tree Stephen Rothwell <sfr@canb.auug.org.au> - 2017-05-15 04:00 +0200
    Re: linux-next: build warning after merge of the akpm-current tree Xunlei Pang <xpang@redhat.com> - 2017-05-15 06:10 +0200
      Re: linux-next: build warning after merge of the akpm-current tree Stephen Rothwell <sfr@canb.auug.org.au> - 2017-05-15 07:10 +0200

#1641243 — linux-next: build warning after merge of the akpm-current tree

FromStephen Rothwell <sfr@canb.auug.org.au>
Date2017-05-15 04:00 +0200
Subjectlinux-next: build warning after merge of the akpm-current tree
Message-ID<tHdsJ-1k0-3@gated-at.bofh.it>
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")

-- 
Cheers,
Stephen Rothwell

[toc] | [next] | [standalone]


#1641264

FromXunlei Pang <xpang@redhat.com>
Date2017-05-15 06:10 +0200
Message-ID<tHfux-2UW-1@gated-at.bofh.it>
In reply to#1641243
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 <xlpang@redhat.com>
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 <xlpang@redhat.com>
---
 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

[toc] | [prev] | [next] | [standalone]


#1641280

FromStephen Rothwell <sfr@canb.auug.org.au>
Date2017-05-15 07:10 +0200
Message-ID<tHgqD-3Af-17@gated-at.bofh.it>
In reply to#1641264
Hi Xunlei,

On Mon, 15 May 2017 12:02:18 +0800 Xunlei Pang <xpang@redhat.com> wrote:
>
> 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?

Andrew normally takes these as separate patches and then merges them
before sending them on.

-- 
Cheers,
Stephen Rothwell

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web