From: Dan Carpenter <dan.carpenter@oracle.com>
To: Oliver Hartkopp <socketcan@hartkopp.net>,
Patrick Bellasi <patrick.bellasi@arm.com>,
linux-sparse@vger.kernel.org
Cc: Mao Wenan <maowenan@huawei.com>,
davem@davemloft.net, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH net-next] net: can: Fix compiling warning
Date: Wed, 7 Aug 2019 13:50:42 +0300 [thread overview]
Message-ID: <20190807105042.GK1974@kadam> (raw)
In-Reply-To: <6e1c5aa0-8ed3-eec3-a34d-867ea8f54e9d@hartkopp.net>
On Tue, Aug 06, 2019 at 06:41:44PM +0200, Oliver Hartkopp wrote:
> I compiled the code (the original version), but I do not get that "Should it
> be static?" warning:
>
> user@box:~/net-next$ make C=1
> CALL scripts/checksyscalls.sh
> CALL scripts/atomic/check-atomics.sh
> DESCEND objtool
> CHK include/generated/compile.h
> CHECK net/can/af_can.c
> ./include/linux/sched.h:609:43: error: bad integer constant expression
> ./include/linux/sched.h:609:73: error: invalid named zero-width bitfield
> `value'
> ./include/linux/sched.h:610:43: error: bad integer constant expression
> ./include/linux/sched.h:610:67: error: invalid named zero-width bitfield
> `bucket_id'
> CC [M] net/can/af_can.o
The sched.h errors suppress Sparse warnings so it's broken/useless now.
The code looks like this:
include/linux/sched.h
613 struct uclamp_se {
614 unsigned int value : bits_per(SCHED_CAPACITY_SCALE);
615 unsigned int bucket_id : bits_per(UCLAMP_BUCKETS);
616 unsigned int active : 1;
617 unsigned int user_defined : 1;
618 };
bits_per() is zero and Sparse doesn't like zero sized bitfields.
regards,
dan carpenter
next parent reply other threads:[~2019-08-07 10:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190802033643.84243-1-maowenan@huawei.com>
[not found] ` <0050efdb-af9f-49b9-8d83-f574b3d46a2e@hartkopp.net>
[not found] ` <20190806135231.GJ1974@kadam>
[not found] ` <6e1c5aa0-8ed3-eec3-a34d-867ea8f54e9d@hartkopp.net>
2019-08-07 10:50 ` Dan Carpenter [this message]
2019-08-12 17:19 ` [PATCH net-next] net: can: Fix compiling warning Kees Cook
2019-08-13 12:48 ` Dan Carpenter
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=20190807105042.GK1974@kadam \
--to=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sparse@vger.kernel.org \
--cc=maowenan@huawei.com \
--cc=mingo@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=patrick.bellasi@arm.com \
--cc=socketcan@hartkopp.net \
/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;
as well as URLs for NNTP newsgroup(s).