aboutsummaryrefslogtreecommitdiff
path: root/include/linux/cred.h
diff options
context:
space:
mode:
authorPaul Menage <menage@google.com>2009-07-17 16:16:18 -0700
committerJames Morris <jmorris@namei.org>2009-07-20 08:45:25 +1000
commit1c388ad054fb1ead3dc354b1719570b99e464135 (patch)
tree6ec1bacaf6b75c23562fd0474b3110915a5ba065 /include/linux/cred.h
parent967cc5371113f9806b39a2ebb2174af2883d96fe (diff)
downloadlinux-1c388ad054fb1ead3dc354b1719570b99e464135.tar.gz
include/linux/cred.h: work around gcc-4.2.4 warning in get_cred()
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>
Diffstat (limited to 'include/linux/cred.h')
-rw-r--r--include/linux/cred.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/cred.h b/include/linux/cred.h
index 4fa99969631..b3c76e815d6 100644
--- a/include/linux/cred.h
+++ b/include/linux/cred.h
@@ -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);
}
/**