[PATCH] cred: remove const qualifiers

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Harvey Harrison
Date: Saturday, August 9, 2008 - 4:02 pm

get_new_cred clearly writes through the pointer, so const isn't
appropriate.  Sparse warns thusly:

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

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
 include/linux/cred.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/cred.h b/include/linux/cred.h
index b156ed4..174eb56 100644
--- a/include/linux/cred.h
+++ b/include/linux/cred.h
@@ -176,9 +176,9 @@ static inline struct cred *get_new_cred(struct cred *cred)
  * Get a reference on the specified set of credentials.  The caller must
  * release the reference.
  */
-static inline const struct cred *get_cred(const struct cred *cred)
+static inline struct cred *get_cred(struct cred *cred)
 {
-	return get_new_cred((struct cred *) cred);
+	return get_new_cred(cred);
 }
 
 /**
-- 
1.6.0.rc1.278.g9c632



--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] cred: remove const qualifiers, Harvey Harrison, (Sat Aug 9, 4:02 pm)
Re: [PATCH] cred: remove const qualifiers, David Howells, (Sun Aug 10, 3:58 am)
Re: [PATCH] cred: remove const qualifiers, Andrew Morton, (Tue Aug 19, 12:32 am)
Re: [PATCH] cred: remove const qualifiers, David Howells, (Thu Aug 21, 6:24 am)