From patchwork Tue Dec 19 17:09:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 10123829 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 ED84C602CB for ; Tue, 19 Dec 2017 17:10:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD00F286E0 for ; Tue, 19 Dec 2017 17:10:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF83629184; Tue, 19 Dec 2017 17:10:05 +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=ham 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 B4382286E0 for ; Tue, 19 Dec 2017 17:10:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751589AbdLSRKE (ORCPT ); Tue, 19 Dec 2017 12:10:04 -0500 Received: from mga09.intel.com ([134.134.136.24]:15968 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751171AbdLSRKD (ORCPT ); Tue, 19 Dec 2017 12:10:03 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Dec 2017 09:10:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,427,1508828400"; d="scan'208";a="19586736" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 19 Dec 2017 09:10:00 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 0BE61EF; Tue, 19 Dec 2017 19:09:59 +0200 (EET) From: Andy Shevchenko To: Don Brace , esc.storagedev@microsemi.com, "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v1] scsi: hpsa: Use vsnprintf extension %phN Date: Tue, 19 Dec 2017 19:09:59 +0200 Message-Id: <20171219170959.40768-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.15.1 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 Using this extension reduces the object size. Signed-off-by: Andy Shevchenko --- drivers/scsi/hpsa.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index b0aa5dc1d54c..4c018b653f18 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -4619,21 +4619,13 @@ static int hpsa_scatter_gather(struct ctlr_info *h, return 0; } -#define BUFLEN 128 static inline void warn_zero_length_transfer(struct ctlr_info *h, u8 *cdb, int cdb_len, const char *func) { - char buf[BUFLEN]; - int outlen; - int i; - - outlen = scnprintf(buf, BUFLEN, - "%s: Blocking zero-length request: CDB:", func); - for (i = 0; i < cdb_len; i++) - outlen += scnprintf(buf+outlen, BUFLEN - outlen, - "%02hhx", cdb[i]); - dev_warn(&h->pdev->dev, "%s\n", buf); + dev_warn(&h->pdev->dev, + "%s: Blocking zero-length request: CDB:%*phN\n", + func, cdb_len, cdb); } #define IO_ACCEL_INELIGIBLE 1