From: Tejun Heo <tj@kernel.org>
To: Fengguang Wu <fengguang.wu@intel.com>
Cc: Christopher Li <sparse@chrisli.org>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: kernel/workqueue.c:4434:61: sparse: expression using sizeof bool
Date: Thu, 4 Apr 2013 08:43:51 -0700 [thread overview]
Message-ID: <20130404154351.GM9425@htj.dyndns.org> (raw)
In-Reply-To: <20130404014209.GB7328@localhost>
Hey,
On Thu, Apr 04, 2013 at 09:42:09AM +0800, Fengguang Wu wrote:
> > > 4433 /* copy worker description */
> > > > 4434 probe_kernel_read(&desc_valid, &worker->desc_valid, sizeof(desc_valid));
> > > 4435 if (desc_valid)
> >
> > I don't know what to make of this warning. Yes, it's probing a bool
> > variable and of course using sizeof(bool) to do that. Why does sparse
> > complain about this?
>
> I guess sparse warns on sizeof(bool) because it is compiler defined.
> It may be 1, 4, or even 8 depending on the gcc version and platform.
Yeah, it's copying out a bool so as long as that's the actual size,
it's okay. I mean, it's not like sizeof(long) is constant across
platforms. I'm gonna ignore it but still curious what the warning is
good for.
Thanks.
--
tejun
prev parent reply other threads:[~2013-04-04 15:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <5156dabb.76yJdh7eK0MDrdWo%fengguang.wu@intel.com>
[not found] ` <20130403215718.GH3411@htj.dyndns.org>
2013-04-04 1:42 ` kernel/workqueue.c:4434:61: sparse: expression using sizeof bool Fengguang Wu
2013-04-04 15:43 ` Tejun Heo [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=20130404154351.GM9425@htj.dyndns.org \
--to=tj@kernel.org \
--cc=fengguang.wu@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sparse@chrisli.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