]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
keys: make key_serial() a function if CONFIG_KEYS=y
authorDavid Howells <dhowells@redhat.com>
Tue, 29 Apr 2008 08:01:34 +0000 (01:01 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 29 Apr 2008 15:06:17 +0000 (08:06 -0700)
Make key_serial() an inline function rather than a macro if CONFIG_KEYS=y.
This prevents double evaluation of the key pointer and also provides better
type checking.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/key.h

index ad02d9cfe170f3861b9ad93f0a6128d4f9631ebc..c45c962d1cc527e82aa37f8c76385d87fc236c4a 100644 (file)
@@ -264,7 +264,10 @@ extern int keyring_add_key(struct key *keyring,
 
 extern struct key *key_lookup(key_serial_t id);
 
-#define key_serial(key) ((key) ? (key)->serial : 0)
+static inline key_serial_t key_serial(struct key *key)
+{
+       return key ? key->serial : 0;
+}
 
 #ifdef CONFIG_SYSCTL
 extern ctl_table key_sysctls[];