LKML Archive on
help / color / mirror / Atom feed
From: Nicholas Mc Guire <>
To: Dan Carpenter <>
Cc: Nicholas Mc Guire <>,
	Greg Kroah-Hartman <>,,,
	Abel Moyo <>,
	Larry Finger <>
Subject: Re: [PATCH] staging: rtl8188eu: core: switch with redundant cases
Date: Wed, 4 Feb 2015 14:16:33 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <20150204114324.GB5336@mwanda>

On Wed, 04 Feb 2015, Dan Carpenter wrote:

> Btw, what tool are you using to find these?
working on a set of coccinell scripts - they are not yet
really clean - but this one is simply:

virtual context
virtual patch
virtual org
virtual report

position p;
statement S1;

* if@p (...) S1 else S1

p << assign.p;

print "%s:%s WARNING: condition with no effect" % (p[0].file,p[0].line)

I guess this is not wildly impressive - but it seems to be effective
in finding a lot of broken code. The rate of false postivs has been
supprisingly low (very few case of intentional if==else like in
./fs/kernfs/file.c:661 - which is nicely documented)


  reply	other threads:[~2015-02-04 13:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-04 11:04 Nicholas Mc Guire
2015-02-04 11:42 ` Dan Carpenter
2015-02-04 11:43 ` Dan Carpenter
2015-02-04 13:16   ` Nicholas Mc Guire [this message]
2015-02-04 12:07 ` Rasmus Villemoes

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:

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

  git send-email \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH] staging: rtl8188eu: core: switch with redundant cases' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).