mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] xen/xenbus: fix W=1 build warning in xenbus_va_dev_error  function
@ 2025-06-18  2:01 jiang.peng9
  2025-06-19 12:01 ` Jürgen Groß
  0 siblings, 1 reply; 6+ messages in thread
From: jiang.peng9 @ 2025-06-18  2:01 UTC (permalink / raw)
  To: jgross
  Cc: sstabellini, oleksandr_tyshchenko, jiang.peng9, xen-devel,
	linux-kernel, xu.xin16, yang.yang29


[-- Attachment #1.1.1: Type: text/plain, Size: 1409 bytes --]

From: Peng Jiang <jiang.peng9@zte.com.cn>

This patch fixes a W=1 format-string warning reported by GCC 12.3.0
by annotating xenbus_switch_fatal() and xenbus_va_dev_error()
with the __printf attribute. The attribute enables compile-time
validation of printf-style format strings in these functions.

The original warning trace:
drivers/xen/xenbus/xenbus_client.c:304:9: warning: function 'xenbus_va_dev_error' might be
a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]

Signed-off-by: Peng Jiang <jiang.peng9@zte.com.cn>
---
 drivers/xen/xenbus/xenbus_client.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/xen/xenbus/xenbus_client.c b/drivers/xen/xenbus/xenbus_client.c
index 51b3124b0d56..e73ec225d4a6 100644
--- a/drivers/xen/xenbus/xenbus_client.c
+++ b/drivers/xen/xenbus/xenbus_client.c
@@ -202,6 +202,7 @@ int xenbus_watch_pathfmt(struct xenbus_device *dev,
 }
 EXPORT_SYMBOL_GPL(xenbus_watch_pathfmt);
 
+__printf(4, 5)
 static void xenbus_switch_fatal(struct xenbus_device *, int, int,
                                const char *, ...);
 
@@ -287,6 +288,7 @@ int xenbus_frontend_closed(struct xenbus_device *dev)
 }
 EXPORT_SYMBOL_GPL(xenbus_frontend_closed);
 
+__printf(3, 0)
 static void xenbus_va_dev_error(struct xenbus_device *dev, int err,
                                const char *fmt, va_list ap)
 {
-- 
2.25.1

[-- Attachment #1.1.2: Type: text/html , Size: 2189 bytes --]

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

* Re: [PATCH] xen/xenbus: fix W=1 build warning in xenbus_va_dev_error function
  2025-06-18  2:01 [PATCH] xen/xenbus: fix W=1 build warning in xenbus_va_dev_error function jiang.peng9
@ 2025-06-19 12:01 ` Jürgen Groß
  2025-06-20  0:35   ` jiang.peng9
  2025-06-20  0:41   ` [PATCH v2] " jiang.peng9
  0 siblings, 2 replies; 6+ messages in thread
From: Jürgen Groß @ 2025-06-19 12:01 UTC (permalink / raw)
  To: jiang.peng9
  Cc: sstabellini, oleksandr_tyshchenko, xen-devel, linux-kernel,
	xu.xin16, yang.yang29


[-- Attachment #1.1.1: Type: text/plain, Size: 907 bytes --]

On 18.06.25 04:01, jiang.peng9@zte.com.cn wrote:
> From: Peng Jiang <jiang.peng9@zte.com.cn>
> 
> 
> This patch fixes a W=1 format-string warning reported by GCC 12.3.0
> 
> by annotating xenbus_switch_fatal() and xenbus_va_dev_error()
> 
> with the __printf attribute. The attribute enables compile-time
> 
> validation of printf-style format strings in these functions.
> 
> 
> The original warning trace:
> 
> drivers/xen/xenbus/xenbus_client.c:304:9: warning: function 
> 'xenbus_va_dev_error' might be
> 
> a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
> 
> 
> Signed-off-by: Peng Jiang <jiang.peng9@zte.com.cn>

I'm fine with the changes as such, but please send the patch as a
plain text email (no HTML). Otherwise I'm not able to apply it.

You should look into Documentation/process/email-clients.rst in the
kernel source tree.


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3743 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [PATCH] xen/xenbus: fix W=1 build warning in xenbus_va_dev_error function
  2025-06-19 12:01 ` Jürgen Groß
@ 2025-06-20  0:35   ` jiang.peng9
  2025-06-20  0:41   ` [PATCH v2] " jiang.peng9
  1 sibling, 0 replies; 6+ messages in thread
From: jiang.peng9 @ 2025-06-20  0:35 UTC (permalink / raw)
  To: jgross
  Cc: sstabellini, oleksandr_tyshchenko, xen-devel, linux-kernel,
	xu.xin16, yang.yang29

> I'm fine with the changes as such, but please send the patch as a
> plain text email (no HTML). Otherwise I'm not able to apply it.
>
> You should look into Documentation/process/email-clients.rst in the
> kernel source tree.

My sincere apologies for the HTML format issue. Thank you for your patience and for pointing me to the email guidelines  - I truly appreciate the guidance.
I'll resend the patch immediately as a plain text email to ensure it can be properly applied.

Thank you again for your understanding and for taking the time to review this.

Best regards
Peng

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

* Re: [PATCH v2] xen/xenbus: fix W=1 build warning in xenbus_va_dev_error function
  2025-06-19 12:01 ` Jürgen Groß
  2025-06-20  0:35   ` jiang.peng9
@ 2025-06-20  0:41   ` jiang.peng9
  2025-06-20  9:50     ` Jürgen Groß
  1 sibling, 1 reply; 6+ messages in thread
From: jiang.peng9 @ 2025-06-20  0:41 UTC (permalink / raw)
  To: jgross
  Cc: sstabellini, oleksandr_tyshchenko, xen-devel, linux-kernel,
	xu.xin16, yang.yang29

From: Peng Jiang <jiang.peng9@zte.com.cn>

This patch fixes a W=1 format-string warning reported by GCC 12.3.0
by annotating xenbus_switch_fatal() and xenbus_va_dev_error()
with the __printf attribute. The attribute enables compile-time
validation of printf-style format strings in these functions.

The original warning trace:
drivers/xen/xenbus/xenbus_client.c:304:9: warning: function 'xenbus_va_dev_error' might be
a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]

Signed-off-by: Peng Jiang <jiang.peng9@zte.com.cn>
---
 drivers/xen/xenbus/xenbus_client.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/xen/xenbus/xenbus_client.c b/drivers/xen/xenbus/xenbus_client.c
index 51b3124b0d56..e73ec225d4a6 100644
--- a/drivers/xen/xenbus/xenbus_client.c
+++ b/drivers/xen/xenbus/xenbus_client.c
@@ -202,6 +202,7 @@ int xenbus_watch_pathfmt(struct xenbus_device *dev,
 }
 EXPORT_SYMBOL_GPL(xenbus_watch_pathfmt);

+__printf(4, 5)
 static void xenbus_switch_fatal(struct xenbus_device *, int, int,
                                const char *, ...);

@@ -287,6 +288,7 @@ int xenbus_frontend_closed(struct xenbus_device *dev)
 }
 EXPORT_SYMBOL_GPL(xenbus_frontend_closed);

+__printf(3, 0)
 static void xenbus_va_dev_error(struct xenbus_device *dev, int err,
                                const char *fmt, va_list ap)
 {
-- 
2.25.1

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

* Re: [PATCH v2] xen/xenbus: fix W=1 build warning in xenbus_va_dev_error function
  2025-06-20  0:41   ` [PATCH v2] " jiang.peng9
@ 2025-06-20  9:50     ` Jürgen Groß
  2025-06-21  6:11       ` jiang.peng9
  0 siblings, 1 reply; 6+ messages in thread
From: Jürgen Groß @ 2025-06-20  9:50 UTC (permalink / raw)
  To: jiang.peng9
  Cc: sstabellini, oleksandr_tyshchenko, xen-devel, linux-kernel,
	xu.xin16, yang.yang29


[-- Attachment #1.1.1: Type: text/plain, Size: 800 bytes --]

On 20.06.25 02:41, jiang.peng9@zte.com.cn wrote:
> From: Peng Jiang <jiang.peng9@zte.com.cn>
> 
> This patch fixes a W=1 format-string warning reported by GCC 12.3.0
> by annotating xenbus_switch_fatal() and xenbus_va_dev_error()
> with the __printf attribute. The attribute enables compile-time
> validation of printf-style format strings in these functions.
> 
> The original warning trace:
> drivers/xen/xenbus/xenbus_client.c:304:9: warning: function 'xenbus_va_dev_error' might be
> a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
> 
> Signed-off-by: Peng Jiang <jiang.peng9@zte.com.cn>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

PS: Next time please don't send another version of a patch as a reply,
     but as a new email thread.

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3743 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [PATCH v2] xen/xenbus: fix W=1 build warning in xenbus_va_dev_error function
  2025-06-20  9:50     ` Jürgen Groß
@ 2025-06-21  6:11       ` jiang.peng9
  0 siblings, 0 replies; 6+ messages in thread
From: jiang.peng9 @ 2025-06-21  6:11 UTC (permalink / raw)
  To: jgross
  Cc: sstabellini, oleksandr_tyshchenko, xen-devel, linux-kernel,
	xu.xin16, yang.yang29

> PS: Next time please don't send another version of a patch as a reply,
>      but as a new email thread.

Got it! New threads for future patches - thanks for the heads up.Sorry for any inconvenience caused, 
and thanks again for your patience with a newcomer like me.

Best regards
Peng

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

end of thread, other threads:[~2025-06-21  6:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-18  2:01 [PATCH] xen/xenbus: fix W=1 build warning in xenbus_va_dev_error function jiang.peng9
2025-06-19 12:01 ` Jürgen Groß
2025-06-20  0:35   ` jiang.peng9
2025-06-20  0:41   ` [PATCH v2] " jiang.peng9
2025-06-20  9:50     ` Jürgen Groß
2025-06-21  6:11       ` jiang.peng9

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®