提交 7249db2c 编写于 作者: D David Howells 提交者: Linus Torvalds

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: NDavid Howells <dhowells@redhat.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 fdb89bce
......@@ -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[];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册