Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp244969rdb; Mon, 15 Jan 2024 21:02:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IHdZ+ImqqTNN8aTky3EQA1XiweTlzlA7+rW2gO8UYBezxZhM0Wheaa7cFzIttsmnQCq0ek6 X-Received: by 2002:a05:6214:1c0b:b0:681:2505:1eef with SMTP id u11-20020a0562141c0b00b0068125051eefmr7157143qvc.39.1705381354441; Mon, 15 Jan 2024 21:02:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705381354; cv=none; d=google.com; s=arc-20160816; b=mAmaVxyaj/UywwajqCk3UQtBXGbAzDDzZ60QJTytcXg46Ex/KMdkQDvcAOtrlC16em QyD8iM6axslRz7ObZKSYi7yNAnzZ+ja3gxul9BMEB81SWl9d7E5dNuDXW+f8cKpwBP5I UEh69gFUDJTagC5L0p35J973vAfABs17r6NM99BraMf3JDLKz5YWgB8v2M4k0ngw7wSQ O/8D1po4B073Ahx+P0WbdB44ghPB3HwmcL0oZJ2dwHvwqfVADd0a4H9DiPzskOCKKUuo MXs5FLe9bjfFgNGaTrK0U1wLrP1U8kS0dxG0rfcnheMSl/AcRL/vIQ8LIKnv8EE6B8x6 uIyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=ZGsFEX+S5U7YqNVvXiaBE8MQViKyHnJpV1eleH2Yxj8=; fh=jd8sKBc+r48QoQHXTX9UooaF8UF7cfTOOGVFI3czz0k=; b=LnF/MFI7g9pEeRI4L7Ln2LN/kOy3MjsOeun9GfI46rCEQIL77jlaW72L3SHl+b0wUo KuKJTwfv9A/hObtbOaIqmTWUGqg8Qsgf4j8/hRLhN27NmeYfn+1dBZt7lPaEvitP6hXT lw5whQl0YsDvPHY5CwwQe433Ti7RrzVH/PflfO8Cj1xZXZd21UGqtNXCihmXpWybIKZn 5vDzXJmheEpBKzCh802Cl2sUi8ZGPJKa6raLmH5m/pG8w3G90var1xACIka67j6X14Ac HtZZQFrQImBoUc9ierr9QYiH4I/JgzI/QrG3v+XOaD4cBQgF1MLnv7vnzp2kXxQCcEMB xKQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-26992-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26992-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id vr26-20020a05620a55ba00b0078328d65c15si8925362qkn.476.2024.01.15.21.02.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 21:02:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26992-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-26992-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26992-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 348A61C22661 for ; Tue, 16 Jan 2024 05:02:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 27C551DFCF; Tue, 16 Jan 2024 04:52:43 +0000 (UTC) Received: from esa12.hc1455-7.c3s2.iphmx.com (esa12.hc1455-7.c3s2.iphmx.com [139.138.37.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 75D591CFBC; Tue, 16 Jan 2024 04:52:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fujitsu.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fujitsu.com X-IronPort-AV: E=McAfee;i="6600,9927,10954"; a="125556497" X-IronPort-AV: E=Sophos;i="6.04,198,1695654000"; d="scan'208";a="125556497" Received: from unknown (HELO oym-r3.gw.nic.fujitsu.com) ([210.162.30.91]) by esa12.hc1455-7.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jan 2024 13:52:28 +0900 Received: from oym-m2.gw.nic.fujitsu.com (oym-nat-oym-m2.gw.nic.fujitsu.com [192.168.87.59]) by oym-r3.gw.nic.fujitsu.com (Postfix) with ESMTP id 25237D64AA; Tue, 16 Jan 2024 13:52:26 +0900 (JST) Received: from kws-ab3.gw.nic.fujitsu.com (kws-ab3.gw.nic.fujitsu.com [192.51.206.21]) by oym-m2.gw.nic.fujitsu.com (Postfix) with ESMTP id 460BDBF3FC; Tue, 16 Jan 2024 13:52:25 +0900 (JST) Received: from edo.cn.fujitsu.com (edo.cn.fujitsu.com [10.167.33.5]) by kws-ab3.gw.nic.fujitsu.com (Postfix) with ESMTP id D3095200A7689; Tue, 16 Jan 2024 13:52:24 +0900 (JST) Received: from localhost.localdomain (unknown [10.167.226.45]) by edo.cn.fujitsu.com (Postfix) with ESMTP id 6466F1A0160; Tue, 16 Jan 2024 12:52:24 +0800 (CST) From: Li Zhijian To: linux-kernel@vger.kernel.org Cc: Li Zhijian , Jack Wang , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org Subject: [PATCH 34/42] drivers/scsi/pm8001: Convert snprintf to sysfs_emit Date: Tue, 16 Jan 2024 12:51:43 +0800 Message-Id: <20240116045151.3940401-32-lizhijian@fujitsu.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240116045151.3940401-1-lizhijian@fujitsu.com> References: <20240116041129.3937800-1-lizhijian@fujitsu.com> <20240116045151.3940401-1-lizhijian@fujitsu.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSS-9.1.0.1417-9.0.0.1002-28122.004 X-TM-AS-User-Approved-Sender: Yes X-TMASE-Version: IMSS-9.1.0.1417-9.0.1002-28122.004 X-TMASE-Result: 10--10.666000-10.000000 X-TMASE-MatchedRID: 6SYb29c3rTQ4ibokZ3+Q0CoiRKlBVkYIBXngI6jFvpfvd49YGReckE1N J2MN+nPkgxCMf8A0YpR5sRK06wHV4YtkWgmtdunMLdBFrfY9r2n0swHSFcVJ6MC5DTEMxpeQfiq 1gj2xET8vYRhsicUjm796jCH+PpSbpoPHQXywp1fOvXpg7ONnXX0tCKdnhB58I/9UW5M5dRNp7q EhmmPgy46HM5rqDwqtNBJJYdcA4cyfPD3h/iqauXlHsWGeGzKnLiZ8odpWEsdzUPiHs71J0g== X-TMASE-SNAP-Result: 1.821001.0001-0-1-22:0,33:0,34:0-0 Per filesystems/sysfs.rst, show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. coccinelle complains that there are still a couple of functions that use snprintf(). Convert them to sysfs_emit(). > ./drivers/scsi/pm8001/pm8001_ctl.c:883:8-16: WARNING: please use sysfs_emit No functional change intended CC: Jack Wang CC: "James E.J. Bottomley" CC: "Martin K. Petersen" CC: linux-scsi@vger.kernel.org Signed-off-by: Li Zhijian --- drivers/scsi/pm8001/pm8001_ctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/pm8001/pm8001_ctl.c b/drivers/scsi/pm8001/pm8001_ctl.c index 5c26a13ffbd2..7b27618fd7b2 100644 --- a/drivers/scsi/pm8001/pm8001_ctl.c +++ b/drivers/scsi/pm8001/pm8001_ctl.c @@ -880,9 +880,9 @@ static ssize_t pm8001_show_update_fw(struct device *cdev, if (pm8001_ha->fw_status != FLASH_IN_PROGRESS) pm8001_ha->fw_status = FLASH_OK; - return snprintf(buf, PAGE_SIZE, "status=%x %s\n", - flash_error_table[i].err_code, - flash_error_table[i].reason); + return sysfs_emit(buf, "status=%x %s\n", + flash_error_table[i].err_code, + flash_error_table[i].reason); } static DEVICE_ATTR(update_fw, S_IRUGO|S_IWUSR|S_IWGRP, pm8001_show_update_fw, pm8001_store_update_fw); -- 2.29.2