From: Pavel Emelyanov Date: Thu, 6 Dec 2007 05:15:05 +0000 (-0800) Subject: [IPV4] ROUTE: Convert rt_hash_lock_init() macro into function X-Git-Tag: MMI-PSA29.97-13-9~37648^2~1204 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1ff1cc202e9a7dbd9f54d1bce5adb44283497185;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git [IPV4] ROUTE: Convert rt_hash_lock_init() macro into function There's no need in having this function exist in a form of macro. Properly formatted function looks much better. Signed-off-by: Pavel Emelyanov Signed-off-by: David S. Miller --- diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 193788381a59..d95e48e8d65c 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -235,16 +235,25 @@ struct rt_hash_bucket { static spinlock_t *rt_hash_locks; # define rt_hash_lock_addr(slot) &rt_hash_locks[(slot) & (RT_HASH_LOCK_SZ - 1)] -# define rt_hash_lock_init() { \ - int i; \ - rt_hash_locks = kmalloc(sizeof(spinlock_t) * RT_HASH_LOCK_SZ, GFP_KERNEL); \ - if (!rt_hash_locks) panic("IP: failed to allocate rt_hash_locks\n"); \ - for (i = 0; i < RT_HASH_LOCK_SZ; i++) \ - spin_lock_init(&rt_hash_locks[i]); \ - } + +static __init void rt_hash_lock_init(void) +{ + int i; + + rt_hash_locks = kmalloc(sizeof(spinlock_t) * RT_HASH_LOCK_SZ, + GFP_KERNEL); + if (!rt_hash_locks) + panic("IP: failed to allocate rt_hash_locks\n"); + + for (i = 0; i < RT_HASH_LOCK_SZ; i++) + spin_lock_init(&rt_hash_locks[i]); +} #else # define rt_hash_lock_addr(slot) NULL -# define rt_hash_lock_init() + +static inline void rt_hash_lock_init(void) +{ +} #endif static struct rt_hash_bucket *rt_hash_table;