Skip to content

Commit

Permalink
net: macb: remove is_udp variable
Browse files Browse the repository at this point in the history
Remove is_udp variable that is used in only one place and use
ip_hdr(skb)->protocol == IPPROTO_UDP check instead.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Claudiu Beznea authored and David S. Miller committed Jul 2, 2020
1 parent 580d395 commit 8932b5a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/net/ethernet/cadence/macb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1933,7 +1933,7 @@ static netdev_tx_t macb_start_xmit(struct sk_buff *skb, struct net_device *dev)
unsigned long flags;
unsigned int desc_cnt, nr_frags, frag_size, f;
unsigned int hdrlen;
bool is_lso, is_udp = 0;
bool is_lso;
netdev_tx_t ret = NETDEV_TX_OK;

if (macb_clear_csum(skb)) {
Expand All @@ -1949,10 +1949,8 @@ static netdev_tx_t macb_start_xmit(struct sk_buff *skb, struct net_device *dev)
is_lso = (skb_shinfo(skb)->gso_size != 0);

if (is_lso) {
is_udp = !!(ip_hdr(skb)->protocol == IPPROTO_UDP);

/* length of headers */
if (is_udp)
if (ip_hdr(skb)->protocol == IPPROTO_UDP)
/* only queue eth + ip headers separately for UDP */
hdrlen = skb_transport_offset(skb);
else
Expand Down

0 comments on commit 8932b5a

Please sign in to comment.