lkml.org 
[lkml]   [2009]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] creds: suppress warning in get_cred
On Mon, Jan 19, 2009 at 11:10 AM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> This is the usual way to force a conversion from a const pointer to a
> non-const one and gets rid of this warning:
>
> include/linux/cred.h: In function 'get_cred':
> include/linux/cred.h:188: warning: passing argument 1 of 'get_new_cred' discards qualifiers from pointer target type
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
> include/linux/cred.h | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/include/linux/cred.h b/include/linux/cred.h
> index 3282ee4..ed38227 100644
> --- a/include/linux/cred.h
> +++ b/include/linux/cred.h
> @@ -12,6 +12,7 @@
> #ifndef _LINUX_CRED_H
> #define _LINUX_CRED_H
>
> +#include <linux/types.h>
> #include <linux/capability.h>
> #include <linux/key.h>
> #include <asm/atomic.h>
> @@ -185,7 +186,7 @@ static inline struct cred *get_new_cred(struct cred *cred)
> */
> static inline const struct cred *get_cred(const struct cred *cred)
> {
> - return get_new_cred((struct cred *) cred);
> + return get_new_cred((struct cred *)(uintptr_t)cred);
> }
>
> /**

This is most likly a compiler bug, see

http://lkml.org/lkml/2008/11/20/441 and followups.

-Hannes


\
 
 \ /
  Last update: 2009-01-19 12:07    [W:1.528 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site