Skip to contentSkip to conversation

Silencing warning: passing argument 1 of 'get_new_cred' discards qualifiers from pointer target type

PATCH New Marin Mitov 1 participant 1 message Apr 9, 2009 Credentials

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Silencing warning: passing argument 1 of 'get_new_cred' discards qualifiers from pointer target type

Hi all,

I do not know if that is worth the effort, but...

Silencing warning: passing argument 1 of 'get_new_cred' discards qualifiers from pointer target type

The proposed change is similar to that used in put_cred() function (few lines lower)

The patch is against 2.6.30-rc1, but should apply to 2.6.29(.1) too.

=============================================================

include/linux/cred.h +3 -1
@@ -185,7 +185,9 @@
  */
 static inline const struct cred *get_cred(const struct cred *cred)
 {
-	return get_new_cred((struct cred *) cred);
+	struct cred *_cred = (struct cred *) cred;
+
+	return get_new_cred(_cred);
 }
 
 /**