public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: julia.lawall@lip6.fr (Julia Lawall)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask
Date: Tue, 6 Feb 2018 14:15:51 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.20.1802061414340.3306@hadrien> (raw)
In-Reply-To: <20180206131044.oso33fvv553trrd7@mwanda>



On Tue, 6 Feb 2018, Dan Carpenter wrote:

> On Mon, Feb 05, 2018 at 09:09:57PM +0100, Wolfram Sang wrote:
> > In one Renesas driver, I found a typo which turned an intended bit shift ('<<')
> > into a comparison ('<'). Because this is a subtle issue, I looked tree wide for
> > similar patterns. This small patch series is the outcome.
> >
> > Buildbot and checkpatch are happy. Only compile-tested. To be applied
> > individually per sub-system, I think. I'd think only the net: amd: patch needs
> > to be conisdered for stable, but I leave this to people who actually know this
> > driver.
> >
> > CCing Dan. Maybe he has an idea how to add a test to smatch? In my setup, only
> > cppcheck reported a 'coding style' issue with a low prio.
> >
>
> Most of these are inside macros so it makes it complicated for Smatch
> to warn about them.  It might be easier in Coccinelle.  Julia the bugs
> look like this:
>
> -			reissue_mask |= 0xffff < 4;
> +			reissue_mask |= 0xffff << 4;

Thanks.  I'll take a look.  Do you have an example of the macro issue
handy?

julia

>
> regards,
> dan carpenter
>
> > Wolfram Sang (4):
> >   v4l: vsp1: fix mask creation for MULT_ALPHA_RATIO
> >   drm/exynos: fix comparison to bitshift when dealing with a mask
> >   v4l: dvb-frontends: stb0899: fix comparison to bitshift when dealing
> >     with a mask
> >   net: amd-xgbe: fix comparison to bitshift when dealing with a mask
> >
> >  drivers/gpu/drm/exynos/regs-fimc.h        | 2 +-
> >  drivers/media/dvb-frontends/stb0899_reg.h | 8 ++++----
> >  drivers/media/platform/vsp1/vsp1_regs.h   | 2 +-
> >  drivers/net/ethernet/amd/xgbe/xgbe-drv.c  | 2 +-
> >  4 files changed, 7 insertions(+), 7 deletions(-)
> >
> > --
> > 2.11.0
>

  reply	other threads:[~2018-02-06 13:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-05 20:09 [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask Wolfram Sang
2018-02-05 20:09 ` [PATCH 2/4] drm/exynos: " Wolfram Sang
2018-02-06  0:06   ` Inki Dae
2018-02-06  8:20 ` [PATCH 0/4] tree-wide: " Geert Uytterhoeven
2018-02-06  8:28   ` Wolfram Sang
2018-02-06 13:10 ` Dan Carpenter
2018-02-06 13:15   ` Julia Lawall [this message]
2018-02-06 13:23     ` Dan Carpenter
2018-02-06 13:40       ` Julia Lawall
2018-02-06 13:53         ` Wolfram Sang
2018-02-06 13:54           ` Julia Lawall
2018-02-06 13:57             ` Wolfram Sang
2018-02-06 13:59         ` Dan Carpenter
2018-02-06 14:08           ` Julia Lawall

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=alpine.DEB.2.20.1802061414340.3306@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=linux-arm-kernel@lists.infradead.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