From patchwork Sun Nov 27 12:35:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: KaiLong Wang X-Patchwork-Id: 26348 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5092892wrr; Sun, 27 Nov 2022 04:38:04 -0800 (PST) X-Google-Smtp-Source: AA0mqf7ZfPjQdrnjpHvv2l1tA3Ebq/yg12jA6LDeTZETVB7uwVsT0inC+CG87SZr4DqgxjNd5FN+ X-Received: by 2002:a17:907:8e09:b0:7bc:420d:709f with SMTP id th9-20020a1709078e0900b007bc420d709fmr11461353ejc.658.1669552681691; Sun, 27 Nov 2022 04:38:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669552681; cv=none; d=google.com; s=arc-20160816; b=ADHjd3pQDM5l9L545+zEQ+WR1icV4iMmczNnujDxDKD7f03Y8maSSS85k4FIfFQfhz hfBk1RB9g4HtbwFGQK7zFQc+lRDPI21S3aY3il2pLtpxV8C39dTaEcp5+SvTY/Go8jzG VuAeCOnpEnal4sbdfzy9NNF7nCokIxpyCdgSOvdiAP/A4u5zRHQlbLyjfyiVTj+Z8kN9 aQaqpNu35vVFPMiiLuKFX8CO+Cl+MB2HUh7RQcYr/KQ50PWJSw/L5XhHJyme+UXwYQNZ ZPUezIATkQt3O5yuFqBbEJOumVB1AjNSdKfvOCiCbBnYD2ljXwri6gDjzue8PBXHzoRD 8jHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:mime-version :content-transfer-encoding:subject:cc:to:from:date; bh=V7VU7TFXe45+rlFrW8mkMq+abQUAt2jw3T+OaKAbrGQ=; b=hdLdf9fyHnoe14wp1H9/o7JeNfpZlXNByuccxRX2MykT6Jih1nxmXNhL68D02pHKaz 65pIjTHtrCPxIM1c2HPVDhkyqC0rcVHtVuqRhZiPR9kWkVVr3meRYpeLG8AREiJ8rmFS KHTBoqNmjdIybtg3adJSBmkRTRoeR1oSWfmJxmLPTsFd9lfLv0Jz1rsEvHMTZ3zpRqwB hCe4aow3OxDPZgBPwpqfMDMMGDHiGNKy+ryhltqXSdTr/rmf4t/DdsfA7XWvp0tKDnep ZjP0MB5kNf4RLUkhoLSFBWVYKW/CgXJFzcG8EriTUJFXghiVx/u+zTtDHdhZ3y2NzT1L BS0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bm8-20020a0564020b0800b0046b1827ed9dsi1368083edb.618.2022.11.27.04.37.38; Sun, 27 Nov 2022 04:38:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229580AbiK0Mfj (ORCPT + 99 others); Sun, 27 Nov 2022 07:35:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbiK0Mfi (ORCPT ); Sun, 27 Nov 2022 07:35:38 -0500 Received: from jari.cn (unknown [218.92.28.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 015B5C76E; Sun, 27 Nov 2022 04:35:27 -0800 (PST) Received: by ajax-webmail-localhost.localdomain (Coremail) ; Sun, 27 Nov 2022 20:35:10 +0800 (GMT+08:00) X-Originating-IP: [182.148.15.36] Date: Sun, 27 Nov 2022 20:35:10 +0800 (GMT+08:00) X-CM-HeaderCharset: UTF-8 From: "KaiLong Wang" To: kartilak@cisco.com, sebaddel@cisco.com, jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] scsi: snic: convert sysfs snprintf to sysfs_emit X-Priority: 3 X-Mailer: Coremail Webmail Server Version XT6.0.1 build 20210329(c53f3fee) Copyright (c) 2002-2022 www.mailtech.cn mispb-4e503810-ca60-4ec8-a188-7102c18937cf-zhkzyfz.cn MIME-Version: 1.0 Message-ID: <716c3cdc.1d2.184b9159597.Coremail.wangkailong@jari.cn> X-Coremail-Locale: zh_CN X-CM-TRANSID: AQAAfwD3C+J+WYNjWXIFAA--.129W X-CM-SenderInfo: 5zdqwypdlo00nj6mt2flof0/1tbiAQAJB2FEYx0EXwAGsJ X-Coremail-Antispam: 1Ur529EdanIXcx71UUUUU7IcSsGvfJ3iIAIbVAYjsxI4VWxJw CS07vEb4IE77IF4wCS07vE1I0E4x80FVAKz4kxMIAIbVAFxVCaYxvI4VCIwcAKzIAtYxBI daVFxhVjvjDU= X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00,RCVD_IN_PBL,RDNS_NONE, T_SPF_HELO_PERMERROR,T_SPF_PERMERROR,XPRIO autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750652872772417560?= X-GMAIL-MSGID: =?utf-8?q?1750652872772417560?= Fix the following coccicheck warning: drivers/scsi/snic/snic_attrs.c:26:8-16: WARNING: use scnprintf or sprintf drivers/scsi/snic/snic_attrs.c:16:8-16: WARNING: use scnprintf or sprintf drivers/scsi/snic/snic_attrs.c:35:8-16: WARNING: use scnprintf or sprintf drivers/scsi/snic/snic_attrs.c:48:8-16: WARNING: use scnprintf or sprintf Signed-off-by: KaiLong Wang --- drivers/scsi/snic/snic_attrs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/snic/snic_attrs.c b/drivers/scsi/snic/snic_attrs.c index 3ddbdbc3ded1..6e8f4d0b9c3c 100644 --- a/drivers/scsi/snic/snic_attrs.c +++ b/drivers/scsi/snic/snic_attrs.c @@ -13,7 +13,7 @@ snic_show_sym_name(struct device *dev, { struct snic *snic = shost_priv(class_to_shost(dev)); - return snprintf(buf, PAGE_SIZE, "%s\n", snic->name); + return sysfs_emit(buf, "%s\n", snic->name); } static ssize_t @@ -23,7 +23,7 @@ snic_show_state(struct device *dev, { struct snic *snic = shost_priv(class_to_shost(dev)); - return snprintf(buf, PAGE_SIZE, "%s\n", + return sysfs_emit(buf, "%s\n", snic_state_str[snic_get_state(snic)]); } @@ -32,7 +32,7 @@ snic_show_drv_version(struct device *dev, struct device_attribute *attr, char *buf) { - return snprintf(buf, PAGE_SIZE, "%s\n", SNIC_DRV_VERSION); + return sysfs_emit(buf, "%s\n", SNIC_DRV_VERSION); } static ssize_t @@ -45,7 +45,7 @@ snic_show_link_state(struct device *dev, if (snic->config.xpt_type == SNIC_DAS) snic->link_status = svnic_dev_link_status(snic->vdev); - return snprintf(buf, PAGE_SIZE, "%s\n", + return sysfs_emit(buf, "%s\n", (snic->link_status) ? "Link Up" : "Link Down"); }