提交 1a914990 编写于 作者: C Colin Ian King 提交者: David S. Miller

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: NColin Ian King <colin.king@canonical.com>
Reviewed-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 3f1071ec
......@@ -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];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册