net: qualcomm: rmnet: Fix the return value of rmnet_rx_handler()
authorSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Thu, 26 Oct 2017 17:06:46 +0000 (11:06 -0600)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Oct 2017 15:10:23 +0000 (00:10 +0900)
Since packet is always consumed by rmnet_rx_handler(), we always
return RX_HANDLER_CONSUMED. There is no need to pass on this
value through multiple functions.

Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h
drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c

index df3d2d16ce550a348b65fe01bea47b9dc361e838..5dd186d4d0e43ef4cb858cac020f449b324c7ff2 100644 (file)
@@ -43,7 +43,7 @@ static void rmnet_set_skb_proto(struct sk_buff *skb)
 
 /* Generic handler */
 
-static rx_handler_result_t
+static void
 rmnet_deliver_skb(struct sk_buff *skb)
 {
        skb_reset_transport_header(skb);
@@ -53,12 +53,11 @@ rmnet_deliver_skb(struct sk_buff *skb)
        skb->pkt_type = PACKET_HOST;
        skb_set_mac_header(skb, 0);
        netif_receive_skb(skb);
-       return RX_HANDLER_CONSUMED;
 }
 
 /* MAP handler */
 
-static rx_handler_result_t
+static void
 __rmnet_map_ingress_handler(struct sk_buff *skb,
                            struct rmnet_port *port)
 {
@@ -91,31 +90,27 @@ __rmnet_map_ingress_handler(struct sk_buff *skb,
        skb_pull(skb, sizeof(struct rmnet_map_header));
        skb_trim(skb, len);
        rmnet_set_skb_proto(skb);
-       return rmnet_deliver_skb(skb);
+       rmnet_deliver_skb(skb);
+       return;
 
 free_skb:
        kfree_skb(skb);
-       return RX_HANDLER_CONSUMED;
 }
 
-static rx_handler_result_t
+static void
 rmnet_map_ingress_handler(struct sk_buff *skb,
                          struct rmnet_port *port)
 {
        struct sk_buff *skbn;
-       int rc;
 
        if (port->ingress_data_format & RMNET_INGRESS_FORMAT_DEAGGREGATION) {
                while ((skbn = rmnet_map_deaggregate(skb)) != NULL)
                        __rmnet_map_ingress_handler(skbn, port);
 
                consume_skb(skb);
-               rc = RX_HANDLER_CONSUMED;
        } else {
-               rc = __rmnet_map_ingress_handler(skb, port);
+               __rmnet_map_ingress_handler(skb, port);
        }
-
-       return rc;
 }
 
 static int rmnet_map_egress_handler(struct sk_buff *skb,
@@ -149,15 +144,13 @@ static int rmnet_map_egress_handler(struct sk_buff *skb,
        return RMNET_MAP_SUCCESS;
 }
 
-static rx_handler_result_t
+static void
 rmnet_bridge_handler(struct sk_buff *skb, struct net_device *bridge_dev)
 {
        if (bridge_dev) {
                skb->dev = bridge_dev;
                dev_queue_xmit(skb);
        }
-
-       return RX_HANDLER_CONSUMED;
 }
 
 /* Ingress / Egress Entry Points */
@@ -168,13 +161,12 @@ rmnet_bridge_handler(struct sk_buff *skb, struct net_device *bridge_dev)
  */
 rx_handler_result_t rmnet_rx_handler(struct sk_buff **pskb)
 {
-       int rc = RX_HANDLER_CONSUMED;
        struct sk_buff *skb = *pskb;
        struct rmnet_port *port;
        struct net_device *dev;
 
        if (!skb)
-               return RX_HANDLER_CONSUMED;
+               goto done;
 
        dev = skb->dev;
        port = rmnet_get_port(dev);
@@ -182,14 +174,15 @@ rx_handler_result_t rmnet_rx_handler(struct sk_buff **pskb)
        switch (port->rmnet_mode) {
        case RMNET_EPMODE_VND:
                if (port->ingress_data_format & RMNET_INGRESS_FORMAT_MAP)
-                       rc = rmnet_map_ingress_handler(skb, port);
+                       rmnet_map_ingress_handler(skb, port);
                break;
        case RMNET_EPMODE_BRIDGE:
-               rc = rmnet_bridge_handler(skb, port->bridge_ep);
+               rmnet_bridge_handler(skb, port->bridge_ep);
                break;
        }
 
-       return rc;
+done:
+       return RX_HANDLER_CONSUMED;
 }
 
 /* Modifies packet as per logical endpoint configuration and egress data format
index ce2302c25b128dcf28dc73cd61865994460c9897..3af3fe7b54570e76b37ed8b43a19cbf2d674fdb6 100644 (file)
@@ -80,7 +80,6 @@ u8 rmnet_map_demultiplex(struct sk_buff *skb);
 struct sk_buff *rmnet_map_deaggregate(struct sk_buff *skb);
 struct rmnet_map_header *rmnet_map_add_map_header(struct sk_buff *skb,
                                                  int hdrlen, int pad);
-rx_handler_result_t rmnet_map_command(struct sk_buff *skb,
-                                     struct rmnet_port *port);
+void rmnet_map_command(struct sk_buff *skb, struct rmnet_port *port);
 
 #endif /* _RMNET_MAP_H_ */
index 74d362f71cce935d654d23f16a86a3cc230bdca5..51e604923ac19ab4bc4362be89273630cdc88626 100644 (file)
@@ -76,8 +76,7 @@ static void rmnet_map_send_ack(struct sk_buff *skb,
 /* Process MAP command frame and send N/ACK message as appropriate. Message cmd
  * name is decoded here and appropriate handler is called.
  */
-rx_handler_result_t rmnet_map_command(struct sk_buff *skb,
-                                     struct rmnet_port *port)
+void rmnet_map_command(struct sk_buff *skb, struct rmnet_port *port)
 {
        struct rmnet_map_control_command *cmd;
        unsigned char command_name;
@@ -102,5 +101,4 @@ rx_handler_result_t rmnet_map_command(struct sk_buff *skb,
        }
        if (rc == RMNET_MAP_COMMAND_ACK)
                rmnet_map_send_ack(skb, rc);
-       return RX_HANDLER_CONSUMED;
 }