From: "Hannes Eder" <hannes@hanneseder.net>
To: "David Howells" <dhowells@redhat.com>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] CRED: fix compilation warning in function 'get_cred'
Date: Thu, 20 Nov 2008 23:00:17 +0100 [thread overview]
Message-ID: <154e089b0811201400w6b5d249eyc21ebb9a76133d08@mail.gmail.com> (raw)
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);
}
/**
next reply other threads:[~2008-11-20 22:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-20 22:00 Hannes Eder [this message]
2008-11-20 22:19 ` David Howells
2008-11-21 14:54 ` Hannes Eder
2008-11-21 16:25 ` David Howells
2008-11-21 20:22 ` Hannes Eder
2008-11-22 0:36 ` 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=154e089b0811201400w6b5d249eyc21ebb9a76133d08@mail.gmail.com \
--to=hannes@hanneseder.net \
--cc=dhowells@redhat.com \
--cc=kernel-janitors@vger.kernel.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®