From: Gong Ruiqi <gongruiqi1@huawei.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Wang Weiyang <wangweiyang2@huawei.com>,
<linux-kernel@vger.kernel.org>, <kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH -next] drivers/base/node.c: make CACHE_ATTR define static DEVICE_ATTR_RO
Date: Thu, 13 May 2021 21:22:44 +0800 [thread overview]
Message-ID: <017d9fae-328f-e93f-095e-bdfa0cc2f2ff@huawei.com> (raw)
In-Reply-To: <YJ0M5HcXIQQFOTEq@kroah.com>
On 2021/05/13 19:26, Greg Kroah-Hartman wrote:
> On Thu, May 13, 2021 at 07:07:16PM +0800, Ruiqi Gong wrote:
>> The Sparse tool reports as follows:
>>
>> drivers/base/node.c:239:1: warning:
>> symbol 'dev_attr_line_size' was not declared. Should it be static?
>> drivers/base/node.c:240:1: warning:
>> symbol 'dev_attr_indexing' was not declared. Should it be static?
>>
>> These symbols (and several others) are defined by DEVICE_ATTR_RO(name) in
>> CACHE_ATTR(name, fmt), and all of them are not used outside of node.c. So let's
>> mark DEVICE_ATTR_RO(name) static to solve these complains from Sparse.
>
> Why not fix them all at once? Why only one here?
Sorry for not making it clear enough. Actually the patch does fix them
all. Those symbols reported by Sparse are generated when two of the
following macros are expanded:
CACHE_ATTR(size, "%llu")
CACHE_ATTR(line_size, "%u")
CACHE_ATTR(indexing, "%u")
CACHE_ATTR(write_policy, "%u")
So one fix of the CACHE_ATTR's definition fixs them all.
>
> thanks,
>
> greg k-h
> .
>
.
next prev parent reply other threads:[~2021-05-13 13:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-13 11:07 [PATCH -next] drivers/base/node.c: make CACHE_ATTR define static DEVICE_ATTR_RO Ruiqi Gong
2021-05-13 11:26 ` Greg Kroah-Hartman
2021-05-13 13:22 ` Gong Ruiqi [this message]
2021-05-13 13:50 ` Greg Kroah-Hartman
2021-05-13 13:49 ` Gong Ruiqi
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=017d9fae-328f-e93f-095e-bdfa0cc2f2ff@huawei.com \
--to=gongruiqi1@huawei.com \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wangweiyang2@huawei.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 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).