hippi: dead code issue on skb->data DMA limitations check

From: Colin Ian King
Date: Wed Sep 18 2019 - 08:07:09 EST


Hi there,

Static analysis with Coverity has detected an issue in rr_init1() in
drivers/net/hippi/rrunner.c as follows:

CID 13516 (#1 of 1): Operands don't affect result
(CONSTANT_EXPRESSION_RESULT)

result_independent_of_operands: ((unsigned long)skb->data & 4095) >
18446744073709486295UL /* ~0xff28 */ is always false regardless of the
values of its operands. This occurs as the logical operand of if.

653 /*
654 * Sanity test to see if we conflict with the DMA
655 * limitations of the Roadrunner.
656 */
657 if ((((unsigned long)skb->data) & 0xfff) > ~65320)

CID 14371: Logically dead code (DEADCODE)

658 printk("skb alloc error\n");
659

Given that this check is currently dead code and it's been in the driver
for ages, should we just throw this check away or fix it? I'm not
entirely sure what the original intent was, so I'm not clear on a fix.

Colin