[PATCH -next v2] drivers/base/node.c: make CACHE_ATTR define static DEVICE_ATTR_RO
From: Ruiqi Gong
Date: Thu May 13 2021 - 22:14:15 EST
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 <hulkci@xxxxxxxxxx>
Signed-off-by: Ruiqi Gong <gongruiqi1@xxxxxxxxxx>
---
v2: Rewrite the commit message
drivers/base/node.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/node.c b/drivers/base/node.c
index f449dbb2c746..27f251c2742a 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")