mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 16:54:20 +08:00
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 <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
fdb89bce6c
commit
7249db2c28
@ -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[];
|
||||
|
Loading…
Reference in New Issue
Block a user