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

From: Colin Ian King <hidden>
Date: 2019-09-18 12:07:09
Also in: lkml

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help