lkml.org 
[lkml]   [2008]   [Nov]   [20]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateThu, 20 Nov 2008 23:00:17 +0100
From"Hannes Eder" <>
Subject[PATCH] CRED: fix compilation warning in function 'get_cred'
Fix to following warning by introducing a temporary variable:

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

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
---
With -O2 the same code as for the original function is generated.
 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 26c1ab1..2ab8cf7 100644
--- a/include/linux/cred.h
+++ b/include/linux/cred.h
@@ -184,7 +184,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 *non_const_cred = (struct cred *) cred;
+	return get_new_cred(non_const_cred);
 }

 /**

\
 
 \ /
  Last update: 2008-11-20 23:03    [from the cache]
©2003-2008