diff mbox

[ovs-dev,4/6] dpif-netlink-rtnl: Fix dead store reported by clang.

Message ID 1497898444-116702-4-git-send-email-bhanuprakash.bodireddy@intel.com
State Accepted
Headers show

Commit Message

Bodireddy, Bhanuprakash June 19, 2017, 6:54 p.m. UTC
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(-)

Comments

Mark Kavanagh June 23, 2017, 9:40 a.m. UTC | #1
>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
Ben Pfaff July 12, 2017, 4:05 a.m. UTC | #2
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 mbox

Patch

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))