From: Bill Wendling <morbo@google.com>
To: Mika Westerberg <mika.westerberg@linux.intel.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev
Cc: torvalds@linux-foundation.org, Bill Wendling <morbo@google.com>
Subject: [PATCH v2] gpiolib: acpi: use correct format characters
Date: Sat, 19 Mar 2022 15:22:28 -0700 [thread overview]
Message-ID: <20220319222228.4160598-1-morbo@google.com> (raw)
In-Reply-To: <20220316213055.2351342-1-morbo@google.com>
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 casts to unsigned to
retain the behavior or the "hh" modifier..
Link: https://github.com/ClangBuiltLinux/linux/issues/378
Signed-off-by: Bill Wendling <morbo@google.com>
---
v2 - Cast "pin" to retain the same width as the original.
---
drivers/gpio/gpiolib-acpi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index a5495ad31c9c..92dd9b8784f2 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -388,9 +388,9 @@ 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);
+ (unsigned char)pin);
if (ACPI_SUCCESS(acpi_get_handle(handle, ev_name, &evt_handle)))
handler = acpi_gpio_irq_handler;
}
--
2.35.1.894.gb6a874cedc-goog
next prev parent reply other threads:[~2022-03-19 22:22 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Bill Wendling [this message]
2022-03-19 22:54 ` [PATCH v2] " 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
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=20220319222228.4160598-1-morbo@google.com \
--to=morbo@google.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=brgl@bgdev.pl \
--cc=linus.walleij@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=mika.westerberg@linux.intel.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).