Commit 38b99e1e authored by Hao Chen's avatar Hao Chen Committed by David S. Miller
Browse files

net: hnss3: use max() to simplify code



Replace the "? :" statement wich max() to simplify code.

Signed-off-by: default avatarHao Chen <chenhao288@hisilicon.com>
Signed-off-by: default avatarGuangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5aea2da5
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -971,8 +971,7 @@ static u32 hns3_tx_spare_space(struct hns3_enet_ring *ring)
	/* The free tx buffer is divided into two part, so pick the
	 * larger one.
	 */
	return (ntc > (tx_spare->len - ntu) ? ntc :
			(tx_spare->len - ntu)) - 1;
	return max(ntc, tx_spare->len - ntu) - 1;
}

static void hns3_tx_spare_update(struct hns3_enet_ring *ring)