Commit c80bbeae authored by Hans Zhang's avatar Hans Zhang Committed by David S. Miller

netlink: cleanup the unnecessary return value check

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: default avatarHans Zhang <zhanghonghui@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 45f00f99
...@@ -128,7 +128,7 @@ static rtnl_doit_func rtnl_get_doit(int protocol, int msgindex) ...@@ -128,7 +128,7 @@ static rtnl_doit_func rtnl_get_doit(int protocol, int msgindex)
if (tab == NULL || tab[msgindex].doit == NULL) if (tab == NULL || tab[msgindex].doit == NULL)
tab = rtnl_msg_handlers[PF_UNSPEC]; 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) 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) ...@@ -143,7 +143,7 @@ static rtnl_dumpit_func rtnl_get_dumpit(int protocol, int msgindex)
if (tab == NULL || tab[msgindex].dumpit == NULL) if (tab == NULL || tab[msgindex].dumpit == NULL)
tab = rtnl_msg_handlers[PF_UNSPEC]; 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) 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) ...@@ -158,7 +158,7 @@ static rtnl_calcit_func rtnl_get_calcit(int protocol, int msgindex)
if (tab == NULL || tab[msgindex].calcit == NULL) if (tab == NULL || tab[msgindex].calcit == NULL)
tab = rtnl_msg_handlers[PF_UNSPEC]; tab = rtnl_msg_handlers[PF_UNSPEC];
return tab ? tab[msgindex].calcit : NULL; return tab[msgindex].calcit;
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment