From: Ammar Faizi <[email protected]>
To: Robert Moore <[email protected]>,
"Rafael J. Wysocki" <[email protected]>
Cc: Ammar Faizi <[email protected]>,
Len Brown <[email protected]>,
Nick Desaulniers <[email protected]>,
Tom Rix <[email protected]>, Nathan Chancellor <[email protected]>,
Linux ACPI Mailing List <[email protected]>,
Linux Kernel Mailing List <[email protected]>,
ACPICA Mailing List <[email protected]>,
LLVM Mailing List <[email protected]>,
GNU/Weeb Mailing List <[email protected]>
Subject: [PATCH v1 0/2] clang warning cleanups
Date: Fri, 23 Dec 2022 21:24:17 +0700 [thread overview]
Message-ID: <[email protected]> (raw)
From: Ammar Faizi <[email protected]>
Hi,
On top of Linus' tree. This series fixes clang warnings.
Base commit: 8395ae05cb5a2e31d36106e8c85efa11cda849be ("Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi")
# Patch 1:
Compiling with clang-16:
drivers/acpi/acpi_lpit.c:142:6: error: no previous prototype \
for function 'acpi_init_lpit' [-Werror,-Wmissing-prototypes]
drivers/acpi/ioapic.c:212:6: error: no previous prototype \
for function 'pci_ioapic_remove' [-Werror,-Wmissing-prototypes]
drivers/acpi/ioapic.c:229:5: error: no previous prototype \
for function 'acpi_ioapic_remove' [-Werror,-Wmissing-prototypes]
Include "internal.h" to silence them.
# Patch 2:
@num_carats is used for debugging, passed to the 'ACPI_DEBUG_PRINT()'
macro. But this macro will expand to nothing when debug is disabled,
resulting in the following (clang-16):
drivers/acpi/acpica/nsaccess.c:295:6: error: variable 'num_carats' set \
but not used [-Werror,-Wunused-but-set-variable]
u32 num_carats;
^
1 error generated.
Move the variable declaration inside the else block to reduce the scope,
then add '(void)num_carats' to silence the warning when debug is disabled.
Signed-off-by: Ammar Faizi <[email protected]>
---
Ammar Faizi (2):
ACPI: Silence missing prototype warnings
ACPICA: Silence 'unused-but-set variable' warning
drivers/acpi/acpi_lpit.c | 1 +
drivers/acpi/acpica/nsaccess.c | 4 ++--
drivers/acpi/ioapic.c | 1 +
3 files changed, 4 insertions(+), 2 deletions(-)
base-commit: 8395ae05cb5a2e31d36106e8c85efa11cda849be
--
Ammar Faizi
next reply other threads:[~2022-12-23 14:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-23 14:24 Ammar Faizi [this message]
2022-12-23 14:24 ` [PATCH v1 1/2] ACPI: Silence missing prototype warnings Ammar Faizi
2022-12-30 18:13 ` Rafael J. Wysocki
2022-12-23 14:24 ` [PATCH v1 2/2] ACPICA: Silence 'unused-but-set variable' warning Ammar Faizi
2022-12-30 18:17 ` Rafael J. Wysocki
2022-12-23 15:33 ` [PATCH v1 0/2] clang warning cleanups Ammar Faizi
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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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