Message ID | 1497898444-116702-4-git-send-email-bhanuprakash.bodireddy@intel.com |
---|---|
State | Accepted |
Headers | show |
>From: ovs-dev-bounces@openvswitch.org [mailto:ovs-dev-bounces@openvswitch.org] On Behalf Of >Bhanuprakash Bodireddy >Sent: Monday, June 19, 2017 7:54 PM >To: dev@openvswitch.org >Subject: [ovs-dev] [PATCH 4/6] dpif-netlink-rtnl: Fix dead store reported by clang. > >Clang reports variable 'ifmsg' never been used in the function. Hi Bhanu, LGTM - I also compiled this with gcc, clang, and sparse without issue. Checkpatch reports no obvious problems either. Acked-by: Mark Kavanagh <mark.b.kavanagh@intel.com> Cheers, Mark > >Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com> >--- > lib/dpif-netlink-rtnl.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > >diff --git a/lib/dpif-netlink-rtnl.c b/lib/dpif-netlink-rtnl.c >index c3c31eb..17ae24a 100644 >--- a/lib/dpif-netlink-rtnl.c >+++ b/lib/dpif-netlink-rtnl.c >@@ -140,11 +140,9 @@ rtnl_policy_parse(const char *kind, struct ofpbuf *reply, > { > struct nlattr *linkinfo[ARRAY_SIZE(linkinfo_policy)]; > struct nlattr *rtlink[ARRAY_SIZE(rtlink_policy)]; >- struct ifinfomsg *ifmsg; > int error = 0; > >- ifmsg = ofpbuf_at(reply, NLMSG_HDRLEN, sizeof *ifmsg); >- if (!nl_policy_parse(reply, NLMSG_HDRLEN + sizeof *ifmsg, >+ if (!nl_policy_parse(reply, NLMSG_HDRLEN + sizeof(struct ifinfomsg), > rtlink_policy, rtlink, ARRAY_SIZE(rtlink_policy)) > || !nl_parse_nested(rtlink[IFLA_LINKINFO], linkinfo_policy, > linkinfo, ARRAY_SIZE(linkinfo_policy)) >-- >2.4.11 > >_______________________________________________ >dev mailing list >dev@openvswitch.org >https://mail.openvswitch.org/mailman/listinfo/ovs-dev
On Mon, Jun 19, 2017 at 07:54:02PM +0100, Bhanuprakash Bodireddy wrote: > Clang reports variable 'ifmsg' never been used in the function. > > Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com> Thanks, applied to master.
diff --git a/lib/dpif-netlink-rtnl.c b/lib/dpif-netlink-rtnl.c index c3c31eb..17ae24a 100644 --- a/lib/dpif-netlink-rtnl.c +++ b/lib/dpif-netlink-rtnl.c @@ -140,11 +140,9 @@ rtnl_policy_parse(const char *kind, struct ofpbuf *reply, { struct nlattr *linkinfo[ARRAY_SIZE(linkinfo_policy)]; struct nlattr *rtlink[ARRAY_SIZE(rtlink_policy)]; - struct ifinfomsg *ifmsg; int error = 0; - ifmsg = ofpbuf_at(reply, NLMSG_HDRLEN, sizeof *ifmsg); - if (!nl_policy_parse(reply, NLMSG_HDRLEN + sizeof *ifmsg, + if (!nl_policy_parse(reply, NLMSG_HDRLEN + sizeof(struct ifinfomsg), rtlink_policy, rtlink, ARRAY_SIZE(rtlink_policy)) || !nl_parse_nested(rtlink[IFLA_LINKINFO], linkinfo_policy, linkinfo, ARRAY_SIZE(linkinfo_policy))
Clang reports variable 'ifmsg' never been used in the function. Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com> --- lib/dpif-netlink-rtnl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)