summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2019-08-30 10:07:11 +0100
committerDavid S. Miller <davem@davemloft.net>2019-08-30 12:31:52 -0700
commit1a914990ffe997090a516681ac97519e7c1b22a2 (patch)
tree5e6330edaf836bc70225cc14a8aaa6ca8c509611
parent3f1071ec39f79ad1e288d2f8e5cbe5697ced695b (diff)
downloadtalos-op-linux-1a914990ffe997090a516681ac97519e7c1b22a2.tar.gz
talos-op-linux-1a914990ffe997090a516681ac97519e7c1b22a2.zip
wimax/i2400m: remove debug containing bogus calculation of index
The subtraction of the two pointers is automatically scaled by the size of the size of the object the pointers point to, so the division by sizeof(*i2400m->barker) is incorrect. This has been broken since day one of the driver and is only debug, so remove the debug completely. Also move && in condition to clean up a checkpatch warning. Addresses-Coverity: ("Extra sizeof expression") Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/wimax/i2400m/fw.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/net/wimax/i2400m/fw.c b/drivers/net/wimax/i2400m/fw.c
index 489cba9b284d..6c9a41bff2e0 100644
--- a/drivers/net/wimax/i2400m/fw.c
+++ b/drivers/net/wimax/i2400m/fw.c
@@ -397,14 +397,9 @@ int i2400m_is_boot_barker(struct i2400m *i2400m,
/* Short circuit if we have already discovered the barker
* associated with the device. */
- if (i2400m->barker
- && !memcmp(buf, i2400m->barker, sizeof(i2400m->barker->data))) {
- unsigned index = (i2400m->barker - i2400m_barker_db)
- / sizeof(*i2400m->barker);
- d_printf(2, dev, "boot barker cache-confirmed #%u/%08x\n",
- index, le32_to_cpu(i2400m->barker->data[0]));
+ if (i2400m->barker &&
+ !memcmp(buf, i2400m->barker, sizeof(i2400m->barker->data)))
return 0;
- }
for (i = 0; i < i2400m_barker_db_used; i++) {
barker = &i2400m_barker_db[i];
OpenPOWER on IntegriCloud