From: David Howells Date: Tue, 29 Apr 2008 08:01:34 +0000 (-0700) Subject: keys: make key_serial() a function if CONFIG_KEYS=y X-Git-Tag: v2.6.26-rc1~500 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=7249db2c281ac688977ecc6862cdee9969d310e2;p=linux-2.6-omap-h63xx.git keys: make key_serial() a function if CONFIG_KEYS=y 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/key.h b/include/linux/key.h index ad02d9cfe17..c45c962d1cc 100644 --- a/include/linux/key.h +++ b/include/linux/key.h @@ -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[];