Commit 0a3ca086 authored by Karol Kolacinski's avatar Karol Kolacinski Committed by Tony Nguyen

ice: remove u16 arithmetic in ice_gnss

Change u16 to unsigned int where arithmetic occurs.
Signed-off-by: default avatarKarol Kolacinski <karol.kolacinski@intel.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 b33de560
...@@ -17,13 +17,13 @@ static void ice_gnss_read(struct kthread_work *work) ...@@ -17,13 +17,13 @@ static void ice_gnss_read(struct kthread_work *work)
struct gnss_serial *gnss = container_of(work, struct gnss_serial, struct gnss_serial *gnss = container_of(work, struct gnss_serial,
read_work.work); read_work.work);
struct ice_aqc_link_topo_addr link_topo; struct ice_aqc_link_topo_addr link_topo;
u8 i2c_params, bytes_read; unsigned int i, bytes_read, data_len;
struct tty_port *port; struct tty_port *port;
struct ice_pf *pf; struct ice_pf *pf;
struct ice_hw *hw; struct ice_hw *hw;
__be16 data_len_b; __be16 data_len_b;
char *buf = NULL; char *buf = NULL;
u16 i, data_len; u8 i2c_params;
int err = 0; int err = 0;
pf = gnss->back; pf = gnss->back;
...@@ -65,7 +65,7 @@ static void ice_gnss_read(struct kthread_work *work) ...@@ -65,7 +65,7 @@ static void ice_gnss_read(struct kthread_work *work)
mdelay(10); mdelay(10);
} }
data_len = min(data_len, (u16)PAGE_SIZE); data_len = min_t(typeof(data_len), data_len, PAGE_SIZE);
data_len = tty_buffer_request_room(port, data_len); data_len = tty_buffer_request_room(port, data_len);
if (!data_len) { if (!data_len) {
err = -ENOMEM; err = -ENOMEM;
...@@ -74,9 +74,10 @@ static void ice_gnss_read(struct kthread_work *work) ...@@ -74,9 +74,10 @@ static void ice_gnss_read(struct kthread_work *work)
/* Read received data */ /* Read received data */
for (i = 0; i < data_len; i += bytes_read) { for (i = 0; i < data_len; i += bytes_read) {
u16 bytes_left = data_len - i; unsigned int bytes_left = data_len - i;
bytes_read = min_t(typeof(bytes_left), bytes_left, ICE_MAX_I2C_DATA_SIZE); bytes_read = min_t(typeof(bytes_left), bytes_left,
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