All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: dpdk-dev <dev@dpdk.org>, Colin Ian King <colin.king@canonical.com>
Subject: Re: cppcheck on dpdk
Date: Wed, 16 May 2018 18:03:08 +0200	[thread overview]
Message-ID: <20180516160308.GC6497@6wind.com> (raw)
In-Reply-To: <fa189212-b6a7-309b-a85a-7f766f581b9f@intel.com>

On Wed, May 16, 2018 at 01:41:09PM +0100, Ferruh Yigit wrote:
> Today after listening Colin's Static Analysis talk, I run cppcheck on v18.05-rc4
> code and it revealed some issues, sharing here for anyone to interested in
> fixing them. At least I encourage to check maintainers to check their own pieces.
> 
> It is really easy to run cppcheck, in dpdk source folder:
> cppcheck --force .
> 
> With above command cppcheck verifies all #ifdef paths, some issues below seems
> related to this and that is why these issues not seen in build tests.
<snip>
> [drivers/net/mlx4/mlx4_flow.c:303]: (warning) Possible null pointer dereference:
> mask

False positive, a NULL mask means flow->promisc == 1, in which case this
code isn't reached.

> [drivers/net/mlx4/mlx4_rxtx.c:266]: (error) Shifting signed 32-bit value by 31
> bits is undefined behaviour
> [drivers/net/mlx4/mlx4_rxtx.c:624]: (error) Shifting signed 32-bit value by 31
> bits is undefined behaviour
> [drivers/net/mlx4/mlx4_txq.c:89]: (error) Shifting signed 32-bit value by 31
> bits is undefined behaviour
> [drivers/net/mlx4/mlx4_txq.c:91]: (error) Shifting signed 32-bit value by 31
> bits is undefined behaviour

Indeed, I'll send fixes shortly for these. Thanks!

-- 
Adrien Mazarguil
6WIND

  reply	other threads:[~2018-05-16 16:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-16 12:41 cppcheck on dpdk Ferruh Yigit
2018-05-16 16:03 ` Adrien Mazarguil [this message]
2018-05-31 11:22 ` Ferruh Yigit
2018-09-25 16:55   ` Ferruh Yigit
2018-05-31 11:28 ` Colin Ian King

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=20180516160308.GC6497@6wind.com \
    --to=adrien.mazarguil@6wind.com \
    --cc=colin.king@canonical.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.