Skip to content

Commit 7e5dd53

Browse files
Colin Ian Kingdavem330
authored andcommitted
net_sched: use explicit size of struct tcmsg, remove need to declare tcm
Pointer tcm is being initialized and is never read, it is only being used to determine the size of struct tcmsg. Clean this up by removing variable tcm and explicitly using the sizeof struct tcmsg rather than *tcm. Cleans up clang warning: warning: Value stored to 'tcm' during its initialization is never read Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 21d0556 commit 7e5dd53

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

net/sched/sch_api.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,6 @@ static int tc_dump_qdisc(struct sk_buff *skb, struct netlink_callback *cb)
15001500
int s_idx, s_q_idx;
15011501
struct net_device *dev;
15021502
const struct nlmsghdr *nlh = cb->nlh;
1503-
struct tcmsg *tcm = nlmsg_data(nlh);
15041503
struct nlattr *tca[TCA_MAX + 1];
15051504
int err;
15061505

@@ -1510,7 +1509,7 @@ static int tc_dump_qdisc(struct sk_buff *skb, struct netlink_callback *cb)
15101509
idx = 0;
15111510
ASSERT_RTNL();
15121511

1513-
err = nlmsg_parse(nlh, sizeof(*tcm), tca, TCA_MAX, NULL, NULL);
1512+
err = nlmsg_parse(nlh, sizeof(struct tcmsg), tca, TCA_MAX, NULL, NULL);
15141513
if (err < 0)
15151514
return err;
15161515

0 commit comments

Comments
 (0)