From patchwork Wed Dec 9 21:18:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 7812301 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E85ACBEEE1 for ; Wed, 9 Dec 2015 21:23:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D3E042053D for ; Wed, 9 Dec 2015 21:23:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BF88C2053A for ; Wed, 9 Dec 2015 21:23:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752187AbbLIVXM (ORCPT ); Wed, 9 Dec 2015 16:23:12 -0500 Received: from bby1mta03.pmc-sierra.com ([216.241.235.118]:58966 "EHLO bby1mta03.pmc-sierra.bc.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751410AbbLIVXL (ORCPT ); Wed, 9 Dec 2015 16:23:11 -0500 Received: from bby1mta03.pmc-sierra.bc.ca (localhost.pmc-sierra.bc.ca [127.0.0.1]) by localhost (Postfix) with SMTP id 93BF310708EE; Wed, 9 Dec 2015 13:23:10 -0800 (PST) Received: from bby1uinfra02-temp.pmc-sierra.bc.ca (bby1nis01 [216.241.226.203]) by bby1mta03.pmc-sierra.bc.ca (Postfix) with ESMTP id 5050710708ED; Wed, 9 Dec 2015 13:23:10 -0800 (PST) Received: from [127.0.1.1] (kirk.hou.lab.pmc-sierra.bc.ca [10.238.32.34]) by bby1uinfra02-temp.pmc-sierra.bc.ca (Postfix) with ESMTP id 76B2EE0073; Wed, 9 Dec 2015 13:23:09 -0800 (PST) Subject: [PATCH 1/3] hpsa: fix path_info_show From: Don Brace To: Viswas.G@pmcs.com, scott.teel@pmcs.com, Kevin.Barnett@pmcs.com, scott.benesh@pmcs.com, Mahesh.Rajashekhara@pmcs.com, hch@infradead.org, Justin.Lindley@pmcs.com, elliott@hpe.com, james.bottomley@parallels.com Cc: linux-scsi@vger.kernel.org Date: Wed, 09 Dec 2015 15:18:44 -0600 Message-ID: <20151209211844.519.32243.stgit@brunhilda> In-Reply-To: <20151209211816.519.50876.stgit@brunhilda> References: <20151209211816.519.50876.stgit@brunhilda> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pmcs.com; h=subject:from:to:cc:date:message-id:in-reply-to:references:mime-version:content-type:content-transfer-encoding; s=default; bh=iYmrf78n1GhpfkIgqj3yNIA68Qbjtrqk6pScFdi3HRQ=; b=Rew+8Sm53Cm81zNEKNAZY2j4xjsfNENkI4t2CSyMlP1/yboLBaHj9mjKcWfGilLIXF7KoomluFsXa6sStUxLDggJ7XystccA1XZ5/pObNj7yRxVjRAA0HGiI3MkCLIpzUp/KSql4gnPzF+0h96DH25kAlzDn1KW1Ne5sHHxgGQc= Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP left off some changes from Rasmus Villemoes where he changed snprintf to scnprintf Suggested-by: Rasmus Villemoes Reviewed-by: Justin Lindley Reviewed-by: Kevin Barnett Reviewed-by: Scott Teel Signed-off-by: Don Brace Reviewed-by: Matthew R. Ochs --- drivers/scsi/hpsa.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index a386036..f8370b8 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -795,7 +795,7 @@ static ssize_t path_info_show(struct device *dev, if (hdev->external || hdev->devtype == TYPE_RAID || is_logical_device(hdev)) { - output_len += snprintf(buf + output_len, + output_len += scnprintf(buf + output_len, PAGE_SIZE - output_len, "%s\n", active); continue; @@ -809,28 +809,28 @@ static ssize_t path_info_show(struct device *dev, if (phys_connector[1] < '0') phys_connector[1] = '0'; if (hdev->phys_connector[i] > 0) - output_len += snprintf(buf + output_len, + output_len += scnprintf(buf + output_len, PAGE_SIZE - output_len, "PORT: %.2s ", phys_connector); if (hdev->devtype == TYPE_DISK && hdev->expose_device) { if (box == 0 || box == 0xFF) { - output_len += snprintf(buf + output_len, + output_len += scnprintf(buf + output_len, PAGE_SIZE - output_len, "BAY: %hhu %s\n", bay, active); } else { - output_len += snprintf(buf + output_len, + output_len += scnprintf(buf + output_len, PAGE_SIZE - output_len, "BOX: %hhu BAY: %hhu %s\n", box, bay, active); } } else if (box != 0 && box != 0xFF) { - output_len += snprintf(buf + output_len, + output_len += scnprintf(buf + output_len, PAGE_SIZE - output_len, "BOX: %hhu %s\n", box, active); } else - output_len += snprintf(buf + output_len, + output_len += scnprintf(buf + output_len, PAGE_SIZE - output_len, "%s\n", active); }