PNP: add printf attribute to log function
Subsystems (2)
PATCH 1/1 PNP: add printf attribute to log function
From: Tom Rix <[email protected]>
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 <[email protected]>
--- drivers/pnp/interface.c | 1 + 1 file changed, 1 insertion(+)
drivers/pnp/interface.c +1 -0
@@ -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;
Signature · 1 line
2.27.0
Quoted 16 lines · On Mon, Dec 21, 2020 at 5:04 PM <[email protected]> wrote:
From: Tom Rix <[email protected]>
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 <[email protected]>--- drivers/pnp/interface.c | 1 + 1 file changed, 1 insertion(+)drivers/pnp/interface.c +0
-0
drivers/pnp/interface.c struct pnp_info_buffer {
Quoted 8 lines
drivers/pnp/interface.c +1
-1@@ -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!