From: Karsten Graul <kgraul@linux.ibm.com>
To: David Miller <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, linux-s390@vger.kernel.org,
Heiko Carstens <hca@linux.ibm.com>,
Julian Wiedmann <jwi@linux.ibm.com>
Subject: [PATCH net-next 5/6] s390/ctcm: add __printf format attribute to ctcm_dbf_longtext
Date: Thu, 18 Nov 2021 17:06:06 +0100 [thread overview]
Message-ID: <20211118160607.2245947-6-kgraul@linux.ibm.com> (raw)
In-Reply-To: <20211118160607.2245947-1-kgraul@linux.ibm.com>
From: Heiko Carstens <hca@linux.ibm.com>
Allow the compiler to recognize and check format strings and parameters.
As reported with allmodconfig and W=1:
drivers/s390/net/ctcm_dbug.c: In function ‘ctcm_dbf_longtext’:
drivers/s390/net/ctcm_dbug.c:73:9: error: function ‘ctcm_dbf_longtext’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format]
73 | vsnprintf(dbf_txt_buf, sizeof(dbf_txt_buf), fmt, args);
| ^~~~~~~~~
Acked-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
---
drivers/s390/net/ctcm_dbug.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/s390/net/ctcm_dbug.h b/drivers/s390/net/ctcm_dbug.h
index 675575ef162e..cce11daf3245 100644
--- a/drivers/s390/net/ctcm_dbug.h
+++ b/drivers/s390/net/ctcm_dbug.h
@@ -65,6 +65,7 @@ extern struct ctcm_dbf_info ctcm_dbf[CTCM_DBF_INFOS];
int ctcm_register_dbf_views(void);
void ctcm_unregister_dbf_views(void);
+__printf(3, 4)
void ctcm_dbf_longtext(enum ctcm_dbf_names dbf_nix, int level, char *text, ...);
static inline const char *strtail(const char *s, int n)
--
2.25.1
next prev parent reply other threads:[~2021-11-18 16:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-18 16:06 [PATCH net-next 0/6] s390/net: updates 2021-11-18 Karsten Graul
2021-11-18 16:06 ` [PATCH net-next 1/6] s390/qeth: allocate RX queue at probe time Karsten Graul
2021-11-18 16:06 ` [PATCH net-next 2/6] net/iucv: fix kernel doc comments Karsten Graul
2021-11-18 16:06 ` [PATCH net-next 3/6] net/af_iucv: " Karsten Graul
2021-11-18 16:06 ` [PATCH net-next 4/6] s390/ctcm: fix format string Karsten Graul
2021-11-18 16:06 ` Karsten Graul [this message]
2021-11-18 16:06 ` [PATCH net-next 6/6] s390/lcs: add braces around empty function body Karsten Graul
2021-11-19 11:20 ` [PATCH net-next 0/6] s390/net: updates 2021-11-18 patchwork-bot+netdevbpf
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=20211118160607.2245947-6-kgraul@linux.ibm.com \
--to=kgraul@linux.ibm.com \
--cc=davem@davemloft.net \
--cc=hca@linux.ibm.com \
--cc=jwi@linux.ibm.com \
--cc=kuba@kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.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