From patchwork Tue Dec 27 02:32:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: KaiLong Wang X-Patchwork-Id: 36739 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1190565wrt; Mon, 26 Dec 2022 18:34:35 -0800 (PST) X-Google-Smtp-Source: AMrXdXvdm+TbNZoVPPL4ZNxpcqxFvZsfkhtBKDPhh4RS8lmVaAhUn///e7s88e6kv/AOBZmq6hnO X-Received: by 2002:a17:902:c244:b0:189:603d:ea71 with SMTP id 4-20020a170902c24400b00189603dea71mr22958626plg.58.1672108475344; Mon, 26 Dec 2022 18:34:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672108475; cv=none; d=google.com; s=arc-20160816; b=tQiWXPFXkSrxu3TrmRvfAyV9qaiea1eO7B4gjTaNVPdWu/rm7RQFFFxAm2Ub73/Ukp 1Jc702wsWyn7rV7LakvSW2XxZGXtO+gEuBLit29ZfHNLlefDjE+NGYj1iyEdAu+2TFQL FMUrZO7PyhM+lNWEXtnYo4dSTw/GCfBfMqHRj8oDUimwrzw4xp6BPxCArMbWga1oxetp KMb5cOhGHS1kNxBuebk1TPJA2QeHCFO/h6+tdVBjx8+2eiZj4SrXioVBjE8g1JoVWZh+ F3zNtw5Nur+m414Os8SUzlxA5DIo/yp+IKPcuu78AI8o/ImKU9iRaZUw+jZiobFCeVXo Q86g== 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=mM1qRMEEEXgNL6PY5dZPIp7tdNmnnPdSmMX3BaXFELI=; b=by8lwFFljNZ4qSxEsJVgKK8p39cmmWt82dF8b57M/EgD5bgB2yrZW6SvXXuO9azC5i AnIJMJG6qeXIMMe9+/1gIeqQu018uE5kIZhyrpLAI/OnuC/4j8nnDwUn4Gb6PvTwFse4 nMx2AQYdJZWbTyFdSlgReM+stWCSOjmpK9/wFkJJXj99JsqhA27PILFweny11Icoj2lj 4SzT/1N0upfUyvNfjOdlpmbT1qBEgI8CHY8iwOFKOCnAhNdby8QsPMQ8nymWoVfoHgnl 4/rfcymBuWY9XQkquOuLZp32vTOhRvvRlig3O0abbNXrX1LrbEdOfU7TzcK1oW4Mkmu8 Vqpw== 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 t11-20020a170902bc4b00b0018666611f85si12279146plz.508.2022.12.26.18.34.23; Mon, 26 Dec 2022 18:34:35 -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 S231589AbiL0Cdm (ORCPT + 99 others); Mon, 26 Dec 2022 21:33:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231175AbiL0Cd3 (ORCPT ); Mon, 26 Dec 2022 21:33:29 -0500 Received: from jari.cn (unknown [218.92.28.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 43B9610CA; Mon, 26 Dec 2022 18:33:18 -0800 (PST) Received: by ajax-webmail-localhost.localdomain (Coremail) ; Tue, 27 Dec 2022 10:32:17 +0800 (GMT+08:00) X-Originating-IP: [182.148.15.35] Date: Tue, 27 Dec 2022 10:32:17 +0800 (GMT+08:00) X-CM-HeaderCharset: UTF-8 From: "KaiLong Wang" To: jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] scsi: scsi_transport_sas: Fix the following coccicheck warning: 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: <4a48b6f.39a.185516c69cd.Coremail.wangkailong@jari.cn> X-Coremail-Locale: zh_CN X-CM-TRANSID: AQAAfwCXn+AxWapj12IKAA--.229W X-CM-SenderInfo: 5zdqwypdlo00nj6mt2flof0/1tbiAQADB2FEYx0G1gAVsb 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?1753332816659401459?= X-GMAIL-MSGID: =?utf-8?q?1753332816659401459?= drivers/scsi/scsi_transport_sas.c:525:9-17: WARNING: use scnprintf or sprintf drivers/scsi/scsi_transport_sas.c:572:8-16: WARNING: use scnprintf or sprintf drivers/scsi/scsi_transport_sas.c:1180:9-17: WARNING: use scnprintf or sprintf Signed-off-by: KaiLong Wang --- drivers/scsi/scsi_transport_sas.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c index 74b99f2b0b74..5504067adcf1 100644 --- a/drivers/scsi/scsi_transport_sas.c +++ b/drivers/scsi/scsi_transport_sas.c @@ -522,7 +522,7 @@ show_sas_device_type(struct device *dev, struct sas_phy *phy = transport_class_to_phy(dev); if (!phy->identify.device_type) - return snprintf(buf, 20, "none\n"); + return sysfs_emit(buf, "none\n"); return get_sas_device_type_names(phy->identify.device_type, buf); } static DEVICE_ATTR(device_type, S_IRUGO, show_sas_device_type, NULL); @@ -569,7 +569,7 @@ show_sas_phy_enable(struct device *dev, struct device_attribute *attr, { struct sas_phy *phy = transport_class_to_phy(dev); - return snprintf(buf, 20, "%d\n", phy->enabled); + return sysfs_emit(buf, "%d\n", phy->enabled); } static DEVICE_ATTR(enable, S_IRUGO | S_IWUSR, show_sas_phy_enable, @@ -1177,7 +1177,7 @@ show_sas_rphy_device_type(struct device *dev, struct sas_rphy *rphy = transport_class_to_rphy(dev); if (!rphy->identify.device_type) - return snprintf(buf, 20, "none\n"); + return sysfs_emit(buf, "none\n"); return get_sas_device_type_names( rphy->identify.device_type, buf); }