From: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
To: GOTO Masanori <gotom@debian.or.jp>,
YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>
Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Subject: [PATCH 2/2] pcmcia: nsp_cs: add __printf attribute to logging functions
Date: Sat, 20 May 2017 13:16:28 +0200 [thread overview]
Message-ID: <20170520111628.24787-2-nicolas.iooss_linux@m4x.org> (raw)
In-Reply-To: <20170520111628.24787-1-nicolas.iooss_linux@m4x.org>
Adding __printf attributes helps to detect errors in printf format
strings at build time.
Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
---
drivers/scsi/pcmcia/nsp_cs.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index 5fb6eefc6541..33b982be9763 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -136,7 +136,8 @@ static inline void nsp_inc_resid(struct scsi_cmnd *SCpnt, int residInc)
scsi_set_resid(SCpnt, scsi_get_resid(SCpnt) + residInc);
}
-static void nsp_cs_message(const char *func, int line, char *type, char *fmt, ...)
+static __printf(4, 5)
+void nsp_cs_message(const char *func, int line, char *type, const char *fmt, ...)
{
va_list args;
char buf[NSP_DEBUG_BUF_LEN];
@@ -153,7 +154,8 @@ static void nsp_cs_message(const char *func, int line, char *type, char *fmt, ..
}
#ifdef NSP_DEBUG
-static void nsp_cs_dmessage(const char *func, int line, int mask, char *fmt, ...)
+static __printf(4, 5)
+void nsp_cs_dmessage(const char *func, int line, int mask, const char *fmt, ...)
{
va_list args;
char buf[NSP_DEBUG_BUF_LEN];
--
2.12.2
next prev parent reply other threads:[~2017-05-20 11:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-20 11:16 [PATCH 1/2] scsi: nsp32: add __printf attribute to logging functions Nicolas Iooss
2017-05-20 11:16 ` Nicolas Iooss [this message]
2017-05-20 11:35 ` Joe Perches
2017-05-24 2:02 ` Martin K. Petersen
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=20170520111628.24787-2-nicolas.iooss_linux@m4x.org \
--to=nicolas.iooss_linux@m4x.org \
--cc=gotom@debian.or.jp \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=yokota@netlab.is.tsukuba.ac.jp \
/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