[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20090703004039.22350.27996.stgit@menage.mtv.corp.google.com>
Date: Thu, 02 Jul 2009 17:40:39 -0700
From: Paul Menage <menage@...gle.com>
To: jmorris@...ei.org, dhowells@...hat.com
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH] Fix warning in get_cred()
Fix 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@...gle.com>
---
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 4fa9996..b3c76e8 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);
}
/**
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists