net/mlx5e: Use u8 instead of int for LRO number of segments
authorTariq Toukan <tariqt@mellanox.com>
Thu, 23 Nov 2017 12:29:25 +0000 (14:29 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Mon, 14 May 2018 22:10:21 +0000 (15:10 -0700)
Range of LRO number of segments fits in u8.
Also, bring initialization and declaration together to
save code.

Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c

index 7bbf0db27a01eead64452e5aa9f328acee5fe658..e10422b845cae37a235c2529f1aa5f96dc4d17cb 100644 (file)
@@ -681,11 +681,10 @@ static inline void mlx5e_build_rx_skb(struct mlx5_cqe64 *cqe,
                                      struct mlx5e_rq *rq,
                                      struct sk_buff *skb)
 {
+       u8 lro_num_seg = be32_to_cpu(cqe->srqn) >> 24;
        struct net_device *netdev = rq->netdev;
-       int lro_num_seg;
 
        skb->mac_len = ETH_HLEN;
-       lro_num_seg = be32_to_cpu(cqe->srqn) >> 24;
        if (lro_num_seg > 1) {
                mlx5e_lro_update_hdr(skb, cqe, cqe_bcnt);
                skb_shinfo(skb)->gso_size = DIV_ROUND_UP(cqe_bcnt, lro_num_seg);