Skip to content

Commit

Permalink
include/linux/cred.h: work around gcc-4.2.4 warning in get_cred()
Browse files Browse the repository at this point in the history
With gcc 4.2.4 (building UML) I get the warning

include/linux/cred.h: In function 'get_cred':
include/linux/cred.h:189: warning: passing argument 1 of
'get_new_cred' discards qualifiers from pointer target type

Inserting an additional local variable appears to keep the compiler happy,
although it's not clear to me why this should be needed.

Signed-off-by: Paul Menage <menage@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
  • Loading branch information
Paul Menage authored and James Morris committed Jul 19, 2009
1 parent 967cc53 commit 1c388ad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/linux/cred.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ 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);
struct cred *nonconst_cred = (struct cred *) cred;
return get_new_cred(nonconst_cred);
}

/**
Expand Down

0 comments on commit 1c388ad

Please sign in to comment.