From: Ruiqi Gong Date: Fri, 14 May 2021 02:05:48 +0000 (+0800) Subject: drivers/base/node.c: make CACHE_ATTR define static DEVICE_ATTR_RO X-Git-Tag: v5.14-rc1~67^2~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fd03c075e362edc2ad637dfb5b945d304f80efe5;p=thirdparty%2Fkernel%2Flinux.git drivers/base/node.c: make CACHE_ATTR define static DEVICE_ATTR_RO Mark DEVICE_ATTR_RO(name) in CACHE_ATTR(name, fmt)'s definition as static to fix the following Sparse tool reports: 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? Where dev_attr_{line_size,indexing} are generated by CACHE_ATTR's expansion. Reported-by: Hulk Robot Signed-off-by: Ruiqi Gong Link: https://lore.kernel.org/r/20210514020548.32483-1-gongruiqi1@huawei.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/node.c b/drivers/base/node.c index 2c36f61d30bcb..6d0210357da3f 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c @@ -233,7 +233,7 @@ static ssize_t name##_show(struct device *dev, \ return sysfs_emit(buf, fmt "\n", \ to_cache_info(dev)->cache_attrs.name); \ } \ -DEVICE_ATTR_RO(name); +static DEVICE_ATTR_RO(name); CACHE_ATTR(size, "%llu") CACHE_ATTR(line_size, "%u")