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>
---
include/linux/key.h | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/include/linux/key.h b/include/linux/key.h
index ad02d9c..c45c962 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[];
--
| Jeff Garzik | [PATCH 1/9] irq-remove: core |
| Jamie Lokier | Re: POHMELFS high performance network filesystem. Transactions, failover, performa... |
| Dave Young | Re: 2.6.24-rc3-mm1 |
| Willy Tarreau | Re: From 2.4 to 2.6 to 2.7? |
git: | |
| Dan Miner | Compilation speeds (was Re: No patchlevel 3.} |
| Ian Jackson | RFD: comp.os.linux split |
| X X | X11 GIf viewer somewhere? |
| root | Broken pipe when using reboot/halt, etc. |
| Natalie Protasevich | [BUG] New Kernel Bugs |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
