linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Liu <jeff.liu@oracle.com>
To: David Rientjes <rientjes@google.com>
Cc: Fengguang Wu <fengguang.wu@intel.com>,
	kbuild-all@01.org, Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [next:master 156/212] fs/binfmt_elf.c:158:18: note: in expansion of macro 'min'
Date: Thu, 26 Jun 2014 14:33:04 +0800	[thread overview]
Message-ID: <53ABBEA0.1010307@oracle.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1406252310560.3960@chino.kir.corp.google.com>


On 06/26/2014 14:19 PM, David Rientjes wrote:
> On Thu, 26 Jun 2014, Jeff Liu wrote:
> 
>>>>>    fs/binfmt_elf.c: In function 'get_atrandom_bytes':
>>>>>    include/linux/kernel.h:713:17: warning: comparison of distinct pointer types lacks a cast
>>>>>      (void) (&_min1 == &_min2);  \
>>>>>                     ^
>>>>>>> fs/binfmt_elf.c:158:18: note: in expansion of macro 'min'
>>>>>       size_t chunk = min(nbytes, sizeof(random_variable));
>>>>
>>>> I remember we have the same report on arch mn10300 about half a year ago, but the code
>>>> is correct. :)
>>>>
>>>
>>> Casting the sizeof operator to size_t would fix this issue on am33.
>>
>> Thanks for pointing this out, I once considered to use min_t() to do explicitly casting.
>> However, both values to compare are already size_t, maybe this depending on the compiler's
>> result of what sizeof() would be...
>>
> 
> Have you read arch/mn10300/include/uapi/asm/posix_types.h?  am33 defines 
> this to be unsigned int for gcc version 4.  You would not see this warning 
> with gcc major version != 4 or if you do what I suggested and cast it to 
> size_t.

Ah, that solves it, thanks! 0day tests with am33 cross compiler version 4.6.3.

Cheers,
-Jeff

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2014-06-26  6:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <53aa90d2.Yd3WgTmElIsuiwuV%fengguang.wu@intel.com>
2014-06-25 10:02 ` [next:master 156/212] fs/binfmt_elf.c:158:18: note: in expansion of macro 'min' Fengguang Wu
2014-06-25 11:30   ` Jeff Liu
2014-06-25 19:59     ` Andrew Morton
2014-06-26  1:45       ` Jeff Liu
2014-06-25 22:44     ` David Rientjes
2014-06-26  2:01       ` Jeff Liu
2014-06-26  6:19         ` David Rientjes
2014-06-26  6:33           ` Jeff Liu [this message]
2014-06-26  7:47             ` Fengguang Wu
2014-06-30 22:52               ` [patch] binfmt_elf.c: use get_random_int() to fix entropy depleting fix David Rientjes
2014-06-30 23:05                 ` Kees Cook
2014-06-30 23:06                 ` 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=53ABBEA0.1010307@oracle.com \
    --to=jeff.liu@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=fengguang.wu@intel.com \
    --cc=kbuild-all@01.org \
    --cc=linux-mm@kvack.org \
    --cc=rientjes@google.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;
as well as URLs for NNTP newsgroup(s).