staging: i2400m: use explicit host byte-order types in comparison
PATCH 1/1 staging: i2400m: use explicit host byte-order types in comparison
convert le32 types to host byte-order types before comparison
Signed-off-by karthik alapati <[email protected]>
---
i wonder how these could be false-positives
drivers/staging/wimax/i2400m/fw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/wimax/i2400m/fw.c +2 -2
@@ -191,7 +191,7 @@ void i2400m_bm_cmd_prepare(struct i2400m_bootrom_header *cmd)int i;u32 checksum =0 ;const u32 *checksum_ptr = (void *) cmd->payload; -for (i =0 ; i < cmd->data_size /4 ; i++) +for (i =0 ; i <le32_to_cpu (cmd->data_size) /4 ; i++) checksum +=cpu_to_le32 (*checksum_ptr++); checksum += cmd->command + cmd->target_addr + cmd->data_size; cmd->block_checksum =cpu_to_le32 (checksum);
@@ -506,7 +506,7 @@ ssize_t __i2400m_bm_ack_verify(struct i2400m *i2400m, int opcode, opcode, i2400m_brh_get_response(ack)); goto error_ack_failed; } -if (ack_size < ack->data_size +sizeof (*ack)) { +if (ack_size <le32_to_cpu (ack->data_size) +sizeof (*ack)) { dev_err(dev, "boot-mode cmd %d: SW BUG " "driver provided only %zu bytes for %zu bytes " "of data\n", opcode, ack_size,
Signature · 1 line
2.30.1
Greg Kroah-Hartman
maintainerQuoted 2 lines · karthik alapati
convert le32 types to host byte-order types before comparison
That says what you did, but not _why_ you did it. Please fix up and resend.
thanks,
greg k-h