]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
netlink: cleanup the unnecessary return value check
authorHans Zhang <zhanghonghui@huawei.com>
Mon, 22 Oct 2012 22:21:23 +0000 (22:21 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 23 Oct 2012 17:03:44 +0000 (13:03 -0400)
It's no needed to check the return value of tab since the NULL situation
has been handled already, and the rtnl_msg_handlers[PF_UNSPEC] has been
initialized as non-NULL during the rtnetlink_init().

Signed-off-by: Hans Zhang <zhanghonghui@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/rtnetlink.c

index 76d4c2c3c89b9d170e89c39fbf0ed5729621a0bc..64fe3cca2a4ed949865be0a4574a739e3ac588ef 100644 (file)
@@ -128,7 +128,7 @@ static rtnl_doit_func rtnl_get_doit(int protocol, int msgindex)
        if (tab == NULL || tab[msgindex].doit == NULL)
                tab = rtnl_msg_handlers[PF_UNSPEC];
 
-       return tab ? tab[msgindex].doit : NULL;
+       return tab[msgindex].doit;
 }
 
 static rtnl_dumpit_func rtnl_get_dumpit(int protocol, int msgindex)
@@ -143,7 +143,7 @@ static rtnl_dumpit_func rtnl_get_dumpit(int protocol, int msgindex)
        if (tab == NULL || tab[msgindex].dumpit == NULL)
                tab = rtnl_msg_handlers[PF_UNSPEC];
 
-       return tab ? tab[msgindex].dumpit : NULL;
+       return tab[msgindex].dumpit;
 }
 
 static rtnl_calcit_func rtnl_get_calcit(int protocol, int msgindex)
@@ -158,7 +158,7 @@ static rtnl_calcit_func rtnl_get_calcit(int protocol, int msgindex)
        if (tab == NULL || tab[msgindex].calcit == NULL)
                tab = rtnl_msg_handlers[PF_UNSPEC];
 
-       return tab ? tab[msgindex].calcit : NULL;
+       return tab[msgindex].calcit;
 }
 
 /**