diff options
author | Subash Abhinov Kasiviswanathan <subashab@codeaurora.org> | 2017-10-26 20:06:46 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-10-27 18:10:23 +0300 |
commit | 2ffbbf0f91288f909b3d495cbf029d8e4cc7db66 (patch) | |
tree | 80314edd9c81558d16252ec2d1c6324029947e4a /drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c | |
parent | cc49c8ff68144d64de18fc5d0039356e0060c0e4 (diff) | |
download | linux-2ffbbf0f91288f909b3d495cbf029d8e4cc7db66.tar.xz |
net: qualcomm: rmnet: Fix the return value of rmnet_rx_handler()
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>
Diffstat (limited to 'drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c')
-rw-r--r-- | drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c index df3d2d16ce55..5dd186d4d0e4 100644 --- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c +++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c @@ -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 |