mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: David Howells <dhowells@redhat.com>
Cc: James Morris <jmorris@namei.org>, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] creds: suppress warning in get_cred
Date: Mon, 19 Jan 2009 21:10:31 +1100	[thread overview]
Message-ID: <20090119211031.934b4c19.sfr@canb.auug.org.au> (raw)

This is the usual way to force a conversion from a const pointer to a
non-const one and gets rid of this warning:

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

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 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 3282ee4..ed38227 100644
--- a/include/linux/cred.h
+++ b/include/linux/cred.h
@@ -12,6 +12,7 @@
 #ifndef _LINUX_CRED_H
 #define _LINUX_CRED_H
 
+#include <linux/types.h>
 #include <linux/capability.h>
 #include <linux/key.h>
 #include <asm/atomic.h>
@@ -185,7 +186,7 @@ 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);
+	return get_new_cred((struct cred *)(uintptr_t)cred);
 }
 
 /**
-- 
1.6.0.5

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

             reply	other threads:[~2009-01-19 10:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-19 10:10 Stephen Rothwell [this message]
2009-01-19 11:03 ` Hannes Eder
2009-01-19 14:37   ` Stephen Rothwell
2009-01-19 12:29 ` David Howells
2009-01-19 14:52   ` Stephen Rothwell
2009-01-19 14:59     ` Hannes Eder
2009-01-19 20:19   ` David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090119211031.934b4c19.sfr@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=dhowells@redhat.com \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®