All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: dm-devel@redhat.com
Subject: Re: [bug report] dm: add statistics support
Date: Fri, 16 Mar 2018 13:54:37 +0300	[thread overview]
Message-ID: <20180316105437.qyu2ykg5uyclhnrm@mwanda> (raw)
In-Reply-To: <20180316105220.x7eyeswzlpoyqmcb@mwanda>

On Fri, Mar 16, 2018 at 01:52:20PM +0300, Dan Carpenter wrote:
> Gar.  I'm sorry, this is really new code and you're right that it's
> buggy.
> 
> On Thu, Mar 15, 2018 at 03:25:52PM -0400, Mikulas Patocka wrote:
> > > The patch fd2ed4d25270: "dm: add statistics support" from Aug 16,
> > > 2013, leads to the following static checker warning:
> > > 
> > > 	drivers/md/dm-stats.c:371 dm_stats_create()
> > > 	warn: dead code because of 's->id == ((~0 >> 1))' and 'tmp_s->id < s->id'
> > 
> > ((~0 >> 1)) is -1 and we are comparing it against INT_MAX. Perhaps the 
> > static checker is buggy because it believes that INT_MAX is -1.
> > 
> > INT_MAX definition in the linux kernel is ((int)(~0U>>1)).
> > 
> 
> Yeah, the format of the smatch outputs is bad.  It gets INT_MAX correct
> internally it just prints it out badly.  The problem here is that Smatch
> is crap at parsing loops.  Parsing seems like an essential thing, but

Parsing *loops*, I meant.

regards,
dan carpenter

> you'd be surprised how many times you can get away with parsing them
> badly.  The main issue is that parsing them correctly is probably a big
> slow down because you'd have to go through a lot of code twice...
> 
> Anyway, thanks for looking at this and sorry for the noise.
> 
> regards,
> dan carpenter

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

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-15 14:25 [bug report] dm: add statistics support Dan Carpenter
2018-03-15 19:25 ` Mikulas Patocka
2018-03-16 10:52   ` Dan Carpenter
2018-03-16 10:54     ` Dan Carpenter [this message]

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=20180316105437.qyu2ykg5uyclhnrm@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=dm-devel@redhat.com \
    --cc=mpatocka@redhat.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.