From patchwork Tue Dec 22 16:36:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 7905551 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 488A9BEEE5 for ; Tue, 22 Dec 2015 16:37:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5A3442049E for ; Tue, 22 Dec 2015 16:37:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 18EB920461 for ; Tue, 22 Dec 2015 16:37:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932338AbbLVQh3 (ORCPT ); Tue, 22 Dec 2015 11:37:29 -0500 Received: from bby1mta03.pmc-sierra.com ([216.241.235.118]:32802 "EHLO bby1mta03.pmc-sierra.bc.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932079AbbLVQhZ (ORCPT ); Tue, 22 Dec 2015 11:37:25 -0500 Received: from bby1mta03.pmc-sierra.bc.ca (localhost.pmc-sierra.bc.ca [127.0.0.1]) by localhost (Postfix) with SMTP id 9C52510703E3; Tue, 22 Dec 2015 08:37:24 -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 73690107031E; Tue, 22 Dec 2015 08:37:24 -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 A5233E0073; Tue, 22 Dec 2015 08:37:23 -0800 (PST) Subject: [PATCH v3 1/3] hpsa: fix path_info_show From: Don Brace To: JBottomley@odin.com, 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 Cc: linux-scsi@vger.kernel.org Date: Tue, 22 Dec 2015 10:36:36 -0600 Message-ID: <20151222163636.16655.63103.stgit@brunhilda> In-Reply-To: <20151222163508.16655.97012.stgit@brunhilda> References: <20151222163508.16655.97012.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=UaY2obO6Frx6LJntAfVfXQEodCyQwp/aL7Cxii45DKI=; b=N20aw6d3O4M1n+wCXYAnsAo6OPvKT6m6BNkMxQEMDAbQrBODErmKqZYJf9Vb2QgP9nHjtt/uvMZOBozhmK+lcQakm6PalO70lejmKLZQn6AViauzmTw839LvPvqpQH82NCU/wPROB8j1Jy+LV/swBmn6o42WLW/2bGYIBd1JXYo= 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,RP_MATCHES_RCVD,T_DKIM_INVALID,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 Reviewed-by: Rasmus Villemoes Reviewed-by: Hannes Reinecke Signed-off-by: Don Brace --- 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); }