All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpiolib: acpi: use correct format characters
@ 2022-03-16 21:30 Bill Wendling
  2022-03-17  9:06 ` Andy Shevchenko
  2022-03-19 22:22 ` [PATCH v2] " Bill Wendling
  0 siblings, 2 replies; 18+ messages in thread
From: Bill Wendling @ 2022-03-16 21:30 UTC (permalink / raw)
  To: Mika Westerberg, Andy Shevchenko, Linus Walleij,
	Bartosz Golaszewski, Nathan Chancellor, Nick Desaulniers,
	linux-gpio, linux-acpi, linux-kernel, llvm
  Cc: Bill Wendling

When compiling with -Wformat, clang emits the following warning:

drivers/gpio/gpiolib-acpi.c:393:4: warning: format specifies type
'unsigned char' but the argument has type 'int' [-Wformat]
                        pin);
                        ^~~

The types of these arguments are unconditionally defined, so this patch
updates the format character to the correct ones for ints and unsigned
ints.

Link: ClangBuiltLinux/linux#378
Signed-off-by: Bill Wendling <morbo@google.com>
---
 drivers/gpio/gpiolib-acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index a5495ad31c9c..be6fb2ad2c4a 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -388,7 +388,7 @@ static acpi_status acpi_gpiochip_alloc_event(struct acpi_resource *ares,
 
 	if (pin <= 255) {
 		char ev_name[5];
-		sprintf(ev_name, "_%c%02hhX",
+		sprintf(ev_name, "_%c%02X",
 			agpio->triggering == ACPI_EDGE_SENSITIVE ? 'E' : 'L',
 			pin);
 		if (ACPI_SUCCESS(acpi_get_handle(handle, ev_name, &evt_handle)))
-- 
2.35.1.723.g4982287a31-goog


^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2022-03-21 18:05 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-16 21:30 [PATCH] gpiolib: acpi: use correct format characters Bill Wendling
2022-03-17  9:06 ` Andy Shevchenko
2022-03-17  9:12   ` Andy Shevchenko
2022-03-17 18:11   ` Nick Desaulniers
2022-03-18 14:03     ` Andy Shevchenko
2022-03-18 18:01       ` Nick Desaulniers
2022-03-18 18:25         ` Bill Wendling
2022-03-18 18:29           ` Nick Desaulniers
2022-03-18 18:33             ` Bill Wendling
2022-03-18 18:40             ` Linus Torvalds
2022-03-18 18:46               ` Bill Wendling
2022-03-18 18:31         ` Linus Torvalds
2022-03-19 22:22 ` [PATCH v2] " Bill Wendling
2022-03-19 22:54   ` Linus Torvalds
2022-03-19 23:21     ` Linus Torvalds
2022-03-21 10:07       ` Andy Shevchenko
2022-03-21 17:05         ` Linus Torvalds
2022-03-21 18:04     ` Bill Wendling

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.