switchdev: sparse warning: pass ipv4 fib dst as network-byte order
authorScott Feldman <sfeldma@gmail.com>
Wed, 13 May 2015 06:03:52 +0000 (23:03 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 May 2015 16:26:27 +0000 (12:26 -0400)
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>
drivers/net/ethernet/rocker/rocker.c
net/switchdev/switchdev.c

index 1fc006b446c1a0d38cffdf63bff4196d9bbb3f24..ca533936658bf9b0eadf79f3f6d5f9e43fed75b4 100644 (file)
@@ -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:
@@ -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;
index a267f7728165f07d9842d4373fb7c16c5affe9d0..77f1b6e3f78e7cccbebd0b10192c9bf619c1e9cb 100644 (file)
@@ -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,
@@ -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,