Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp242807rdb; Mon, 15 Jan 2024 20:56:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IFg6XURfq0UjDapbHm2b0hDh5p96Da+wc6nuWmTFGgLG7LKkzZQXmUi0/kEox53CNV7T/Th X-Received: by 2002:a05:622a:13cc:b0:429:ab35:6402 with SMTP id p12-20020a05622a13cc00b00429ab356402mr7825695qtk.2.1705380983331; Mon, 15 Jan 2024 20:56:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705380983; cv=none; d=google.com; s=arc-20160816; b=kQO/KclhMfR/k/x4CLBi8mw9X0Gx3v8gYifeEtoDYbhJ/K+enMr1cogk6s1cI0aTUN kUJ1S98aZWcm9kkxfFXGQcCdxJVOcro39ay/fOtXMzeumZGeRhFsvB5VUXoj0hWk9oRJ VXSeaQm4bGWAS1zmtZ5hXwAseSHZtaSQ5BtwrjdipzPMw3CtgiW3XbYQTf63bdi3p6g5 PAcM16HoxujI/7mV4Ap0OWx1WePiPxsbV/jMyKs5+EPAYXfUuqp89j+6GmuKZro9xAFk QgpH78v/S2r+QYcGfWZhBLvTuDGgccqK2GLbh0HlQh0h7nbx3YJkemiMiDfj9+LJMpTS vyrQ== 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=QTcHWMrU+4DR5mqmLQ8071p+ZyFJWHAF49TGLnMUHFU=; fh=dQHNkmhhpkPpMI0XlHIQI77WkFmVB/OubnQcrkzTwII=; b=hM+LeYsOfAE158lcBqSV/4ajQLzeafuUgZDYOLRKZoHhTJ/kLBLnDHdSAOqjW1mPaF CCsc4Lr9d6+zf48MwMgiwIphXKEkynIzpBaUlu3QgpyB0gc1zT1mhrR56vCeHHiQgzWN Cjhhis+ZiSpcUMD3ETGJFDrX8yoyCRNsQs+Gdqi1TysyNKI7h9NWwzrKVN6kwpibLV9G upT0BEYW8gbgjbUU6mOO0JP4K3h02PPx0yC+5J3gD5izOkip6aR4sldgha/HH7jbkhjt TXYDl/e5Gc7dbumkNLDYFn5XQJ5COu37FrWNusZcV3Dh8TNJOu2vwmCZIwsRoL28Z6Wm jvXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-26975-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26975-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. [147.75.199.223]) by mx.google.com with ESMTPS id p15-20020a05622a13cf00b00429e3202babsi4443233qtk.261.2024.01.15.20.56.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 20:56:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26975-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-26975-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26975-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 02A211C22B63 for ; Tue, 16 Jan 2024 04:56:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 65E9C1B94C; Tue, 16 Jan 2024 04:52:32 +0000 (UTC) Received: from esa1.hc1455-7.c3s2.iphmx.com (esa1.hc1455-7.c3s2.iphmx.com [207.54.90.47]) (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 698A711185; Tue, 16 Jan 2024 04:52:29 +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="146090994" X-IronPort-AV: E=Sophos;i="6.04,198,1695654000"; d="scan'208";a="146090994" Received: from unknown (HELO oym-r2.gw.nic.fujitsu.com) ([210.162.30.90]) by esa1.hc1455-7.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jan 2024 13:52:22 +0900 Received: from oym-m3.gw.nic.fujitsu.com (oym-nat-oym-m3.gw.nic.fujitsu.com [192.168.87.60]) by oym-r2.gw.nic.fujitsu.com (Postfix) with ESMTP id 02402D7AE4; Tue, 16 Jan 2024 13:52:20 +0900 (JST) Received: from kws-ab4.gw.nic.fujitsu.com (kws-ab4.gw.nic.fujitsu.com [192.51.206.22]) by oym-m3.gw.nic.fujitsu.com (Postfix) with ESMTP id ECDD3C1D78; Tue, 16 Jan 2024 13:52:18 +0900 (JST) Received: from edo.cn.fujitsu.com (edo.cn.fujitsu.com [10.167.33.5]) by kws-ab4.gw.nic.fujitsu.com (Postfix) with ESMTP id 8FD5C6B4C7; Tue, 16 Jan 2024 13:52:18 +0900 (JST) Received: from localhost.localdomain (unknown [10.167.226.45]) by edo.cn.fujitsu.com (Postfix) with ESMTP id 1CBC11A015F; Tue, 16 Jan 2024 12:52:18 +0800 (CST) From: Li Zhijian To: linux-kernel@vger.kernel.org Cc: Li Zhijian , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org Subject: [PATCH 16/42] drivers/scsi/53c700: Convert snprintf to sysfs_emit Date: Tue, 16 Jan 2024 12:51:25 +0800 Message-Id: <20240116045151.3940401-14-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.005 X-TM-AS-User-Approved-Sender: Yes X-TMASE-Version: IMSS-9.1.0.1417-9.0.1002-28122.005 X-TMASE-Result: 10--8.081000-10.000000 X-TMASE-MatchedRID: CncXHiplHCc4ibokZ3+Q0CoiRKlBVkYIBXngI6jFvpfvd49YGReckE1N J2MN+nPkgxCMf8A0YpR5sRK06wHV4dL4Vi2vvkbTrMZ+BqQt2NrBOVz0Jwcxl6vCrG0TnfVUg9x e4gtUJtpqw4mhfH/Cj3QJpsmqtg2cHxPMjOKY7A/+HHE8LDNSg8RB0bsfrpPIfiAqrjYtFiQaiK q3Gb1595xakd0mtD8VYl3SnqFqQXdCWGMoSnhDBX7cGd19dSFd 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/53c700.c:2074:8-16: WARNING: please use sysfs_emit No functional change intended CC: "James E.J. Bottomley" CC: "Martin K. Petersen" CC: linux-scsi@vger.kernel.org Signed-off-by: Li Zhijian --- drivers/scsi/53c700.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c index 857be0f3ae5b..85439e976143 100644 --- a/drivers/scsi/53c700.c +++ b/drivers/scsi/53c700.c @@ -2071,7 +2071,7 @@ NCR_700_show_active_tags(struct device *dev, struct device_attribute *attr, char { struct scsi_device *SDp = to_scsi_device(dev); - return snprintf(buf, 20, "%d\n", NCR_700_get_depth(SDp)); + return sysfs_emit(buf, "%d\n", NCR_700_get_depth(SDp)); } static struct device_attribute NCR_700_active_tags_attr = { -- 2.29.2