linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PNP: add printf attribute to log function
@ 2020-12-21 16:03 trix
  2021-01-22 15:21 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: trix @ 2020-12-21 16:03 UTC (permalink / raw)
  To: rafael.j.wysocki; +Cc: linux-acpi, linux-kernel, Tom Rix

From: Tom Rix <trix@redhat.com>

Attributing the function allows the compiler to more thoroughly
check the use of the function with -Wformat and similar flags.

Signed-off-by: Tom Rix <trix@redhat.com>
---
 drivers/pnp/interface.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c
index 187e4a1175b0..602c46893e83 100644
--- a/drivers/pnp/interface.c
+++ b/drivers/pnp/interface.c
@@ -33,6 +33,7 @@ struct pnp_info_buffer {
 
 typedef struct pnp_info_buffer pnp_info_buffer_t;
 
+__printf(2, 3)
 static int pnp_printf(pnp_info_buffer_t * buffer, char *fmt, ...)
 {
 	va_list args;
-- 
2.27.0


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

* Re: [PATCH] PNP: add printf attribute to log function
  2020-12-21 16:03 [PATCH] PNP: add printf attribute to log function trix
@ 2021-01-22 15:21 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2021-01-22 15:21 UTC (permalink / raw)
  To: Tom Rix; +Cc: Rafael Wysocki, ACPI Devel Maling List, Linux Kernel Mailing List

On Mon, Dec 21, 2020 at 5:04 PM <trix@redhat.com> wrote:
>
> From: Tom Rix <trix@redhat.com>
>
> Attributing the function allows the compiler to more thoroughly
> check the use of the function with -Wformat and similar flags.
>
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
>  drivers/pnp/interface.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c
> index 187e4a1175b0..602c46893e83 100644
> --- a/drivers/pnp/interface.c
> +++ b/drivers/pnp/interface.c
> @@ -33,6 +33,7 @@ struct pnp_info_buffer {
>
>  typedef struct pnp_info_buffer pnp_info_buffer_t;
>
> +__printf(2, 3)
>  static int pnp_printf(pnp_info_buffer_t * buffer, char *fmt, ...)
>  {
>         va_list args;
> --

Applied as 5.12 material, thanks!

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

end of thread, other threads:[~2021-01-22 15:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-21 16:03 [PATCH] PNP: add printf attribute to log function trix
2021-01-22 15:21 ` 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).