Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp242474rdb; Mon, 15 Jan 2024 20:55:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IGlLh5yf24gBnsOOjGFUnnMr0n34PvClnsaOHaWkF5fOeUeGK4Ma7WAq6GOtpbTt8gD4YH6 X-Received: by 2002:a05:6830:ecf:b0:6dd:eebc:da3f with SMTP id dq15-20020a0568300ecf00b006ddeebcda3fmr6698247otb.23.1705380918120; Mon, 15 Jan 2024 20:55:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705380918; cv=none; d=google.com; s=arc-20160816; b=JfSmLsRYeErIpk9n1Gf1Utcf64sMorLxE47JwPA1O8CpLPnrjRs1xmhKmgJxLo7lEO 9Ag4GJkOnH97y9wvexXFEsxdGYkZpsAwhfazGtYEtOTTOY2x6pNXzqqr4pgzjf1R4p/D 1Rn9IIBpWojg2Tu6tRVT04LKG82MKvHmLHMB3UIr0H9VXTGzhee/r9G4ycHzRpDRJhF4 3J3CZlyzjnkX/Ty84dEej1yIvsjihzkGOycySraDlvDLFKpSTU1oxtmiq6Pj5/7XfOV2 l4CEYjOryVOnRx3pyJdLTCpDb9wIJdOriXW4D4U9x9qzY22tPSxQtHw4Qn54xVD/a5nv BEsA== 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=wmPZfWWK7YyV6WK4Ii+mYQ9Q061WFjCsm/ehnxzhaag=; fh=gE+BYpngWfpsqZHWkZ7N0RUKNOm3fDEvDJL0NE4Hf3Q=; b=KUu812pxw2WCfVZ9x6nIUeIizOgPy3GDisHKYEsg/FnyYoTvXptU2ub07Q+d6KCBz/ iSMoE2t318AUo5XhOc3+p/Qw1AERH3yZMH3jmT1xJLevosF5AuxSl+0/TRsCg9v8eZRs FoeEx27vZ6ll0GRLfFWRQrb04N/nxI54yF3X7PyYXe30rJyOXqYJFdkmDkyuoklkEe2d eLzD2VyIuGTBxBe+oYRsaQvysJleMK7xw6ijMgflLcBuFi6HKQYxf6slP3c2C73Bbiv2 OdSs2Gennq7ZfFX8aVxYRZ+FCSRsvHIWcMmJzHWDNW7Q10NKdNakS2JhMG921URWPTxn znmQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-26971-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26971-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id q132-20020a632a8a000000b005cdfa6f0bcfsi10156238pgq.466.2024.01.15.20.55.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 20:55:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26971-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-26971-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26971-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id BFEDD284C61 for ; Tue, 16 Jan 2024 04:55:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1A6CC13FF3; Tue, 16 Jan 2024 04:52:31 +0000 (UTC) Received: from esa8.hc1455-7.c3s2.iphmx.com (esa8.hc1455-7.c3s2.iphmx.com [139.138.61.253]) (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 6DE93101D4 for ; Tue, 16 Jan 2024 04:52:28 +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="134244450" X-IronPort-AV: E=Sophos;i="6.04,198,1695654000"; d="scan'208";a="134244450" Received: from unknown (HELO yto-r1.gw.nic.fujitsu.com) ([218.44.52.217]) by esa8.hc1455-7.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jan 2024 13:52:20 +0900 Received: from yto-m3.gw.nic.fujitsu.com (yto-nat-yto-m3.gw.nic.fujitsu.com [192.168.83.66]) by yto-r1.gw.nic.fujitsu.com (Postfix) with ESMTP id 2F362D9DAC for ; Tue, 16 Jan 2024 13:52:17 +0900 (JST) Received: from kws-ab4.gw.nic.fujitsu.com (kws-ab4.gw.nic.fujitsu.com [192.51.206.22]) by yto-m3.gw.nic.fujitsu.com (Postfix) with ESMTP id 74176D9682 for ; Tue, 16 Jan 2024 13:52:16 +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 0199A6B4CB for ; Tue, 16 Jan 2024 13:52:16 +0900 (JST) Received: from localhost.localdomain (unknown [10.167.226.45]) by edo.cn.fujitsu.com (Postfix) with ESMTP id 7F7CC1A015F; Tue, 16 Jan 2024 12:52:15 +0800 (CST) From: Li Zhijian To: linux-kernel@vger.kernel.org Cc: Li Zhijian , Jeremy Kerr , Joel Stanley , Alistar Popple , Eddie James , linux-fsi@lists.ozlabs.org Subject: [PATCH 08/42] drivers/fsi: Convert snprintf to sysfs_emit Date: Tue, 16 Jan 2024 12:51:17 +0800 Message-Id: <20240116045151.3940401-6-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--6.986000-10.000000 X-TMASE-MatchedRID: TWQD+6s80gM4ibokZ3+Q0CoiRKlBVkYIBXngI6jFvpfvd49YGReckE1N J2MN+nPkgxCMf8A0YpR5sRK06wHV4Vf1Vj96FvVcuce7gFxhKa3BOVz0Jwcxl6vCrG0TnfVUilv Ab18i4hNTeKr01gQwdM4WYLmQfXYmpoPHQXywp1eeAiCmPx4NwBnUJ0Ek6yhjxEHRux+uk8h+IC quNi0WJMSWg7TV5TLza2j6oPQpKW77e0LAmXYjTabIaK+IyDxAftwZ3X11IV0= 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/fsi/fsi-master-ast-cf.c:1086:8-16: WARNING: please use sysfs_emit > ./drivers/fsi/fsi-master-gpio.c:721:8-16: WARNING: please use sysfs_emit No functional change intended CC: Jeremy Kerr CC: Joel Stanley CC: Alistar Popple CC: Eddie James CC: linux-fsi@lists.ozlabs.org Signed-off-by: Li Zhijian --- drivers/fsi/fsi-master-ast-cf.c | 3 +-- drivers/fsi/fsi-master-gpio.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/fsi/fsi-master-ast-cf.c b/drivers/fsi/fsi-master-ast-cf.c index 812dfa9a9140..5740b2d9dace 100644 --- a/drivers/fsi/fsi-master-ast-cf.c +++ b/drivers/fsi/fsi-master-ast-cf.c @@ -1083,8 +1083,7 @@ static ssize_t external_mode_show(struct device *dev, { struct fsi_master_acf *master = dev_get_drvdata(dev); - return snprintf(buf, PAGE_SIZE - 1, "%u\n", - master->external_mode ? 1 : 0); + return sysfs_emit(buf, "%u\n", master->external_mode ? 1 : 0); } static ssize_t external_mode_store(struct device *dev, diff --git a/drivers/fsi/fsi-master-gpio.c b/drivers/fsi/fsi-master-gpio.c index ed03da4f2447..286fe1cddf99 100644 --- a/drivers/fsi/fsi-master-gpio.c +++ b/drivers/fsi/fsi-master-gpio.c @@ -718,8 +718,7 @@ static ssize_t external_mode_show(struct device *dev, { struct fsi_master_gpio *master = dev_get_drvdata(dev); - return snprintf(buf, PAGE_SIZE - 1, "%u\n", - master->external_mode ? 1 : 0); + return sysfs_emit(buf, "%u\n", master->external_mode ? 1 : 0); } static ssize_t external_mode_store(struct device *dev, -- 2.29.2