All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] CRED: fix compilation warning in function 'get_cred'
@ 2008-11-20 22:00 ` Hannes Eder
  0 siblings, 0 replies; 9+ messages in thread
From: Hannes Eder @ 2008-11-20 22:00 UTC (permalink / raw)
  To: David Howells, linux-kernel, kernel-janitors

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);
 }

 /**

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-11-22  0:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-20 22:00 [PATCH] CRED: fix compilation warning in function 'get_cred' Hannes Eder
2008-11-20 22:00 ` Hannes Eder
2008-11-20 22:19 ` David Howells
2008-11-21 14:54   ` Hannes Eder
2008-11-21 14:54     ` Hannes Eder
2008-11-21 16:25     ` David Howells
2008-11-21 20:22       ` Hannes Eder
2008-11-21 20:22         ` Hannes Eder
2008-11-22  0:36         ` David Howells

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.