Commit 187dbc15 authored by Wan Jiabing's avatar Wan Jiabing Committed by Tony Nguyen

ice: use min_t() to make code cleaner in ice_gnss

Fix the following coccicheck warning:
./drivers/net/ethernet/intel/ice/ice_gnss.c:79:26-27: WARNING opportunity for min()
Signed-off-by: default avatarWan Jiabing <wanjiabing@vivo.com>
Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent 1c1ed5a4
...@@ -76,8 +76,7 @@ static void ice_gnss_read(struct kthread_work *work) ...@@ -76,8 +76,7 @@ static void ice_gnss_read(struct kthread_work *work)
for (i = 0; i < data_len; i += bytes_read) { for (i = 0; i < data_len; i += bytes_read) {
u16 bytes_left = data_len - i; u16 bytes_left = data_len - i;
bytes_read = bytes_left < ICE_MAX_I2C_DATA_SIZE ? bytes_left : bytes_read = min_t(typeof(bytes_left), bytes_left, ICE_MAX_I2C_DATA_SIZE);
ICE_MAX_I2C_DATA_SIZE;
err = ice_aq_read_i2c(hw, link_topo, ICE_GNSS_UBX_I2C_BUS_ADDR, err = ice_aq_read_i2c(hw, link_topo, ICE_GNSS_UBX_I2C_BUS_ADDR,
cpu_to_le16(ICE_GNSS_UBX_EMPTY_DATA), cpu_to_le16(ICE_GNSS_UBX_EMPTY_DATA),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment