Relax the module get/put in ip_vs_app.c
Subsystems (2)
PATCH 1/1 Relax the module get/put in ip_vs_app.c
Both try_module_get/module_put already handle the module == NULL case, so no need in manual checking.
This patch fits both net-2.6 and net-2.6.25.
Signed-off-by Pavel Emelyanov <[email protected]>
---
net/ipv4/ipvs/ip_vs_app.c +2 -7
@@ -51,18 +51,13 @@ static DEFINE_MUTEX(__ip_vs_app_mutex);*/ static inline int ip_vs_app_get (struct ip_vs_app *app) { -/* test and get the module atomically */ -if (app->module) -return try_module_get (app->module); -else -return 1 ; +return try_module_get (app->module); }static inline void ip_vs_app_put (struct ip_vs_app *app) { -if (app->module) -module_put (app->module); +module_put (app->module); }
Quoted 6 lines · Pavel Emelyanov
Both try_module_get/module_put already handle the module == NULL case, so no need in manual checking.
This patch fits both net-2.6 and net-2.6.25.
Signed-off-by Pavel Emelyanov <[email protected]>
Thanks, that looks fine to me.
Acked-by Simon Horman <[email protected]>
David Miller
maintainerFrom: Simon Horman <[email protected]>
Date: Tue, 20 Nov 2007 11:28:18 +0900
Quoted 11 lines · Pavel Emelyanov
Quoted 6 lines
Both try_module_get/module_put already handle the module == NULL case, so no need in manual checking.
This patch fits both net-2.6 and net-2.6.25.
Signed-off-by Pavel Emelyanov <[email protected]>Thanks, that looks fine to me.
Acked-by Simon Horman <[email protected]>
Me too, applied to net-2.6.25, thanks Pavel.