public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Tom Rix <trix@redhat.com>
To: rafael@kernel.org, lenb@kernel.org
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Tom Rix <trix@redhat.com>
Subject: [PATCH] ACPI: bgrt: use static for BGRT_SHOW kobj_attribute defines
Date: Thu, 21 Apr 2022 12:42:54 -0400	[thread overview]
Message-ID: <20220421164254.859162-1-trix@redhat.com> (raw)

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


             reply	other threads:[~2022-04-21 16:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21 16:42 Tom Rix [this message]
2022-04-22 14:56 ` [PATCH] ACPI: bgrt: use static for BGRT_SHOW kobj_attribute defines Rafael J. Wysocki

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=20220421164254.859162-1-trix@redhat.com \
    --to=trix@redhat.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    /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