Skip to content

Commit

Permalink
switchdev: sparse warning: pass ipv4 fib dst as network-byte order
Browse files Browse the repository at this point in the history
And let driver convert it to host-byte order as needed.

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Scott Feldman authored and David S. Miller committed May 13, 2015
1 parent 22c1f67 commit 7a7ee53
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions drivers/net/ethernet/rocker/rocker.c
Original file line number Diff line number Diff line change
Expand Up @@ -4471,7 +4471,7 @@ static int rocker_port_obj_add(struct net_device *dev,
case SWITCHDEV_OBJ_IPV4_FIB:
fib4 = &obj->ipv4_fib;
err = rocker_port_fib_ipv4(rocker_port, obj->trans,
fib4->dst, fib4->dst_len,
htonl(fib4->dst), fib4->dst_len,
fib4->fi, fib4->tb_id, 0);
break;
default:
Expand Down Expand Up @@ -4525,8 +4525,9 @@ static int rocker_port_obj_del(struct net_device *dev,
case SWITCHDEV_OBJ_IPV4_FIB:
fib4 = &obj->ipv4_fib;
err = rocker_port_fib_ipv4(rocker_port, SWITCHDEV_TRANS_NONE,
fib4->dst, fib4->dst_len, fib4->fi,
fib4->tb_id, ROCKER_OP_FLAG_REMOVE);
htonl(fib4->dst), fib4->dst_len,
fib4->fi, fib4->tb_id,
ROCKER_OP_FLAG_REMOVE);
break;
default:
err = -EOPNOTSUPP;
Expand Down
4 changes: 2 additions & 2 deletions net/switchdev/switchdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ int switchdev_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
struct switchdev_obj fib_obj = {
.id = SWITCHDEV_OBJ_IPV4_FIB,
.ipv4_fib = {
.dst = htonl(dst),
.dst = dst,
.dst_len = dst_len,
.fi = fi,
.tos = tos,
Expand Down Expand Up @@ -699,7 +699,7 @@ int switchdev_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
struct switchdev_obj fib_obj = {
.id = SWITCHDEV_OBJ_IPV4_FIB,
.ipv4_fib = {
.dst = htonl(dst),
.dst = dst,
.dst_len = dst_len,
.fi = fi,
.tos = tos,
Expand Down

0 comments on commit 7a7ee53

Please sign in to comment.