From patchwork Sat May 20 11:16:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Iooss X-Patchwork-Id: 9738557 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DBB0D6034C for ; Sat, 20 May 2017 11:22:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2EA128307 for ; Sat, 20 May 2017 11:22:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B7A1428622; Sat, 20 May 2017 11:22:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 578DC28307 for ; Sat, 20 May 2017 11:22:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751206AbdETLWJ (ORCPT ); Sat, 20 May 2017 07:22:09 -0400 Received: from mx1.polytechnique.org ([129.104.30.34]:57442 "EHLO mx1.polytechnique.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750898AbdETLWJ (ORCPT ); Sat, 20 May 2017 07:22:09 -0400 X-Greylist: delayed 320 seconds by postgrey-1.27 at vger.kernel.org; Sat, 20 May 2017 07:22:09 EDT Received: from localhost.localdomain (32.206.133.77.rev.sfr.net [77.133.206.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ssl.polytechnique.org (Postfix) with ESMTPSA id 10DAD5646C8; Sat, 20 May 2017 13:16:50 +0200 (CEST) From: Nicolas Iooss To: GOTO Masanori , YOKOTA Hiroshi Cc: "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Nicolas Iooss Subject: [PATCH 2/2] pcmcia: nsp_cs: add __printf attribute to logging functions Date: Sat, 20 May 2017 13:16:28 +0200 Message-Id: <20170520111628.24787-2-nicolas.iooss_linux@m4x.org> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170520111628.24787-1-nicolas.iooss_linux@m4x.org> References: <20170520111628.24787-1-nicolas.iooss_linux@m4x.org> X-AV-Checked: ClamAV using ClamSMTP at svoboda.polytechnique.org (Sat May 20 13:16:50 2017 +0200 (CEST)) Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Adding __printf attributes helps to detect errors in printf format strings at build time. Signed-off-by: Nicolas Iooss --- 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];