From patchwork Wed Jul 1 03:45:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Seymour, Shane M" X-Patchwork-Id: 6699741 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 1DC14C05AC for ; Wed, 1 Jul 2015 03:48:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2DD0820501 for ; Wed, 1 Jul 2015 03:48:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C1848204F6 for ; Wed, 1 Jul 2015 03:48:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753027AbbGADsF (ORCPT ); Tue, 30 Jun 2015 23:48:05 -0400 Received: from g9t5009.houston.hp.com ([15.240.92.67]:35326 "EHLO g9t5009.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753030AbbGADsC convert rfc822-to-8bit (ORCPT ); Tue, 30 Jun 2015 23:48:02 -0400 Received: from G9W0364.americas.hpqcorp.net (g9w0364.houston.hp.com [16.216.193.45]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by g9t5009.houston.hp.com (Postfix) with ESMTPS id B5FA83A2; Wed, 1 Jul 2015 03:48:01 +0000 (UTC) Received: from G4W6301.americas.hpqcorp.net (16.210.26.226) by G9W0364.americas.hpqcorp.net (16.216.193.45) with Microsoft SMTP Server (TLS) id 14.3.169.1; Wed, 1 Jul 2015 03:45:50 +0000 Received: from G9W0766.americas.hpqcorp.net ([169.254.4.103]) by G4W6301.americas.hpqcorp.net ([16.210.26.226]) with mapi id 14.03.0169.001; Wed, 1 Jul 2015 03:45:48 +0000 From: "Seymour, Shane M" To: "linux-scsi@vger.kernel.org" , "James Bottomley (JBottomley@Odin.com)" , ISS StorageDev CC: "linux-api@vger.kernel.org" , "Greg KH (greg@kroah.com)" Subject: [PATCH 1/3] hpsa: convert show method snprintf usage to scnprintf Thread-Topic: [PATCH 1/3] hpsa: convert show method snprintf usage to scnprintf Thread-Index: AdCzrYRHaTLXZSTVQre35rlqbssa8w== Date: Wed, 1 Jul 2015 03:45:49 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [16.210.48.15] MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Changed all show method snprintf usage to scnprintf per Documentation/filesystems/sysfs.txt. Signed-off-by: Shane Seymour --- Please let me know if this is not the correct way to submit patches by separating them but keeping them logically together. -- 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 --- a/drivers/scsi/hpsa.c 2015-06-25 15:52:15.633031319 -0500 +++ b/drivers/scsi/hpsa.c 2015-06-30 16:12:58.125990687 -0500 @@ -460,7 +460,7 @@ static ssize_t host_show_firmware_revisi if (!h->hba_inquiry_data) return 0; fwrev = &h->hba_inquiry_data[32]; - return snprintf(buf, 20, "%c%c%c%c\n", + return scnprintf(buf, 20, "%c%c%c%c\n", fwrev[0], fwrev[1], fwrev[2], fwrev[3]); } @@ -470,7 +470,7 @@ static ssize_t host_show_commands_outsta struct Scsi_Host *shost = class_to_shost(dev); struct ctlr_info *h = shost_to_hba(shost); - return snprintf(buf, 20, "%d\n", + return scnprintf(buf, 20, "%d\n", atomic_read(&h->commands_outstanding)); } @@ -481,7 +481,7 @@ static ssize_t host_show_transport_mode( struct Scsi_Host *shost = class_to_shost(dev); h = shost_to_hba(shost); - return snprintf(buf, 20, "%s\n", + return scnprintf(buf, 20, "%s\n", h->transMethod & CFGTBL_Trans_Performant ? "performant" : "simple"); } @@ -493,7 +493,7 @@ static ssize_t host_show_hp_ssd_smart_pa struct Scsi_Host *shost = class_to_shost(dev); h = shost_to_hba(shost); - return snprintf(buf, 30, "HP SSD Smart Path %s\n", + return scnprintf(buf, 30, "HP SSD Smart Path %s\n", (h->acciopath_status == 1) ? "enabled" : "disabled"); } @@ -589,7 +589,7 @@ static ssize_t host_show_resettable(stru struct Scsi_Host *shost = class_to_shost(dev); h = shost_to_hba(shost); - return snprintf(buf, 20, "%d\n", ctlr_is_resettable(h->board_id)); + return scnprintf(buf, 20, "%d\n", ctlr_is_resettable(h->board_id)); } static inline int is_logical_dev_addr_mode(unsigned char scsi3addr[]) @@ -631,7 +631,7 @@ static ssize_t raid_level_show(struct de /* Is this even a logical drive? */ if (!is_logical_dev_addr_mode(hdev->scsi3addr)) { spin_unlock_irqrestore(&h->lock, flags); - l = snprintf(buf, PAGE_SIZE, "N/A\n"); + l = scnprintf(buf, PAGE_SIZE, "N/A\n"); return l; } @@ -639,7 +639,7 @@ static ssize_t raid_level_show(struct de spin_unlock_irqrestore(&h->lock, flags); if (rlevel > RAID_UNKNOWN) rlevel = RAID_UNKNOWN; - l = snprintf(buf, PAGE_SIZE, "RAID %s\n", raid_label[rlevel]); + l = scnprintf(buf, PAGE_SIZE, "RAID %s\n", raid_label[rlevel]); return l; } @@ -662,7 +662,7 @@ static ssize_t lunid_show(struct device } memcpy(lunid, hdev->scsi3addr, sizeof(lunid)); spin_unlock_irqrestore(&h->lock, flags); - return snprintf(buf, 20, "0x%02x%02x%02x%02x%02x%02x%02x%02x\n", + return scnprintf(buf, 20, "0x%02x%02x%02x%02x%02x%02x%02x%02x\n", lunid[0], lunid[1], lunid[2], lunid[3], lunid[4], lunid[5], lunid[6], lunid[7]); } @@ -686,7 +686,7 @@ static ssize_t unique_id_show(struct dev } memcpy(sn, hdev->device_id, sizeof(sn)); spin_unlock_irqrestore(&h->lock, flags); - return snprintf(buf, 16 * 2 + 2, + return scnprintf(buf, 16 * 2 + 2, "%02X%02X%02X%02X%02X%02X%02X%02X" "%02X%02X%02X%02X%02X%02X%02X%02X\n", sn[0], sn[1], sn[2], sn[3], @@ -714,7 +714,7 @@ static ssize_t host_show_hp_ssd_smart_pa } offload_enabled = hdev->offload_enabled; spin_unlock_irqrestore(&h->lock, flags); - return snprintf(buf, 20, "%d\n", offload_enabled); + return scnprintf(buf, 20, "%d\n", offload_enabled); } static DEVICE_ATTR(raid_level, S_IRUGO, raid_level_show, NULL);