Netdev List
 help / color / mirror / Atom feed
From: Colin Ian King <colin.king@canonical.com>
To: Jes Sorensen <jes@trained-monkey.or>,
	"David S. Miller" <davem@davemloft.net>,
	"open list:HIPPI" <linux-hippi@sunsite.dk>,
	netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: hippi: dead code issue on skb->data DMA limitations check
Date: Wed, 18 Sep 2019 13:07:01 +0100	[thread overview]
Message-ID: <aa943a2f-61aa-3210-61da-a2bf734ee6a3@canonical.com> (raw)

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

                 reply	other threads:[~2019-09-18 12:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aa943a2f-61aa-3210-61da-a2bf734ee6a3@canonical.com \
    --to=colin.king@canonical.com \
    --cc=davem@davemloft.net \
    --cc=jes@trained-monkey.or \
    --cc=linux-hippi@sunsite.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox