lkml.org 
[lkml]   [2010]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From"Justin P. Mattock" <>
Subject[PATCH 1/5]security:key.c Fix warning: variable 'key' set but not used
DateSat, 26 Jun 2010 23:47:22 -0700
building with gcc 4.6 I'm getting a warning message:
CC security/keys/keyctl.o
security/keys/keyctl.c: In function 'keyctl_describe_key':
security/keys/keyctl.c:472:14: warning: variable 'key' set but not used

After reading key.h I noticed it says this:
NOTE! key_ref_t is a typedef'd pointer to a type that is not actually
defined. This is because we abuse the bottom bit of the reference to carry a
flag to indicate whether the calling process possesses that key in one of
its keyrings.

In this case the safest approach(in my mind) would be to just
mark the integer __unused. Keep in mind though Im not certain
if this is the right place for this value i.e. will this effect
*instkey or not(please check).

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>

---
security/keys/keyctl.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c
index 13074b4..d7bb74f 100644
--- a/security/keys/keyctl.c
+++ b/security/keys/keyctl.c
@@ -469,7 +469,7 @@ long keyctl_describe_key(key_serial_t keyid,
char __user *buffer,
size_t buflen)
{
- struct key *key, *instkey;
+ struct key *key __attribute__((unused)), *instkey;
key_ref_t key_ref;
char *tmpbuf;
long ret;
--
1.7.1.rc1.21.gf3bd6


\
 
 \ /
  Last update: 2010-06-27 08:51    [from the cache]
©2003-2010