* [PATCH] ACPI: bgrt: use static for BGRT_SHOW kobj_attribute defines
@ 2022-04-21 16:42 Tom Rix
2022-04-22 14:56 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: Tom Rix @ 2022-04-21 16:42 UTC (permalink / raw)
To: rafael, lenb; +Cc: linux-acpi, linux-kernel, Tom Rix
Smatch reports this repesentative issue
bgrt.c:26:1: warning: symbol 'bgrt_attr_version' was not declared. Should it be static?
Similar for *status,type,xoffset,yoffset
These variables are defined with the BGRT_SHOW macro.
For the definition of bgrt_attr_##_name,
the storage-class specifier should be static
Signed-off-by: Tom Rix <trix@redhat.com>
---
drivers/acpi/bgrt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/bgrt.c b/drivers/acpi/bgrt.c
index 02d208732f9a..e4fb9e225ddf 100644
--- a/drivers/acpi/bgrt.c
+++ b/drivers/acpi/bgrt.c
@@ -21,7 +21,7 @@ static struct kobject *bgrt_kobj;
{ \
return sysfs_emit(buf, "%d\n", bgrt_tab._member); \
} \
- struct kobj_attribute bgrt_attr_##_name = __ATTR_RO(_name)
+ static struct kobj_attribute bgrt_attr_##_name = __ATTR_RO(_name)
BGRT_SHOW(version, version);
BGRT_SHOW(status, status);
--
2.27.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ACPI: bgrt: use static for BGRT_SHOW kobj_attribute defines
2022-04-21 16:42 [PATCH] ACPI: bgrt: use static for BGRT_SHOW kobj_attribute defines Tom Rix
@ 2022-04-22 14:56 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2022-04-22 14:56 UTC (permalink / raw)
To: Tom Rix
Cc: Rafael J. Wysocki, Len Brown, ACPI Devel Maling List,
Linux Kernel Mailing List
On Thu, Apr 21, 2022 at 6:43 PM Tom Rix <trix@redhat.com> wrote:
>
> Smatch reports this repesentative issue
> bgrt.c:26:1: warning: symbol 'bgrt_attr_version' was not declared. Should it be static?
> Similar for *status,type,xoffset,yoffset
>
> These variables are defined with the BGRT_SHOW macro.
> For the definition of bgrt_attr_##_name,
> the storage-class specifier should be static
>
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
> drivers/acpi/bgrt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/bgrt.c b/drivers/acpi/bgrt.c
> index 02d208732f9a..e4fb9e225ddf 100644
> --- a/drivers/acpi/bgrt.c
> +++ b/drivers/acpi/bgrt.c
> @@ -21,7 +21,7 @@ static struct kobject *bgrt_kobj;
> { \
> return sysfs_emit(buf, "%d\n", bgrt_tab._member); \
> } \
> - struct kobj_attribute bgrt_attr_##_name = __ATTR_RO(_name)
> + static struct kobj_attribute bgrt_attr_##_name = __ATTR_RO(_name)
>
> BGRT_SHOW(version, version);
> BGRT_SHOW(status, status);
> --
Applied as 5.19 material, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-22 14:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-21 16:42 [PATCH] ACPI: bgrt: use static for BGRT_SHOW kobj_attribute defines Tom Rix
2022-04-22 14:56 ` Rafael J. Wysocki
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).