Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1461796pxb; Sun, 22 Aug 2021 18:14:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmL7gXcRneMteh1d1/ehLl4ESESpdCTVcJdoST/2XuL7X4NICBADLahyy9EGl4kMxuXR+T X-Received: by 2002:a17:906:edc3:: with SMTP id sb3mr33859687ejb.114.1629681274840; Sun, 22 Aug 2021 18:14:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629681274; cv=none; d=google.com; s=arc-20160816; b=eaX2AA1PU7MVCdDLHPwyk9C/tCIVHFy0FQSNPvmNzK8nfScVlAlKr7pz9QRGvktc1E 5Y0A0zFFb5rbeektJoG68vwInWbYxPat2izqDvrYvYoP3nQTjy06uaUXaikzuIY+BNvS brI5VV91Y+Wogd/VVbeRRpV6KTlV5vhe0Smq1Jn9wgr9Qlgr/pVg7xVwsxqAzlFUqMzo aBLmOgmXZLhKXVSKh5u5oA5NA/1j1AHg3Vj9FFzwl/V6BaDp9+xL0JO2OqHzgUvqBjOk zRZ1YU9OLbdjw8zRvXYSFcHK0pWEw3+Yw8X4whHWdEuUPCfE8mVmUbmnpZIdRwtAqnqz 2eVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=3617d1wzXnjSlPLePamFOKaTTSsHAU2Hht3MegCG/fY=; b=hiz+xs5GwzkgKje/gSgbTWsMKWqOv2FyBwOHg8LA/Ms1LSi77QRLSvBgp28W8GXtx4 VpwM7ZrOyweMMPJOSShfD+LDvuATVKb6/5BX3uTHdXHpTLNUJh14NJ2dq6wy0jggCAhR 566dLy5eYGhfzekeefbnILkDN2ipU9AMubYrPQoe3GHqndihU1k+GmuWOHttWsVm59I+ Qr/gQR4iHMILpxHLNVNLulOAz37d1+++f5SwFf2T8DhdEPmmefj0FVEdQNzTxbSUKkjC 3JKJvnbXUeys8uLQ13iRN29cpd/T2AJSoNPEOYKYOYj8+wLm5/EQxXDgqmg67Twz8Vek NGwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ozlabs.org header.s=201707 header.b=s2kUtebB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ozlabs.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jy1si12889105ejc.592.2021.08.22.18.14.11; Sun, 22 Aug 2021 18:14:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ozlabs.org header.s=201707 header.b=s2kUtebB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ozlabs.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232005AbhHWBNa (ORCPT + 99 others); Sun, 22 Aug 2021 21:13:30 -0400 Received: from ozlabs.org ([203.11.71.1]:42813 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231452AbhHWBNa (ORCPT ); Sun, 22 Aug 2021 21:13:30 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4GtDkP4KgRz9sVw; Mon, 23 Aug 2021 11:12:45 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ozlabs.org; s=201707; t=1629681167; bh=3617d1wzXnjSlPLePamFOKaTTSsHAU2Hht3MegCG/fY=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=s2kUtebBLqozNQypZrHVlFYCIKF+v3fOv1IWEJ7sKUi6zPxdPd4xsAojiuo/RS7Fq heRwCeZlJGpGtAQ/qfPzw2vBOJLBkIeLyZjL6dJUtzYuqvbb8id6qtwlc80Od6euKo O51B86WDGQKDjbHFxc4iYSInjLUfQwINJvB7VeXpJgHDs/gz96lX6h2nPNCdO42sYV ptUuLWjotXQhv82OGNqFPPDBHQwo6wZy+lveICPSDNKBK4YkeA3J74/uN3bWtSbM8N +DJzjUfoVz06JWnG0HJEgZD/r1bMyQWckEnT5wlw2PJbCwL9y8LZgk+DFVq+mTzKFO 3wUA52+1jYmLA== Message-ID: Subject: Re: [PATCH linux-next] fsi:(fsi-master-gpio)Convert sysfs sprintf/snprintf family to sysfs_emit From: Jeremy Kerr To: CGEL Cc: Joel Stanley , Alistar Popple , Eddie James , linux-fsi@lists.ozlabs.org, linux-kernel@vger.kernel.org, jing yangyang , Zeal Robot Date: Mon, 23 Aug 2021 09:12:44 +0800 In-Reply-To: <20210821034250.27914-1-jing.yangyang@zte.com.cn> References: <20210821034250.27914-1-jing.yangyang@zte.com.cn> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, > Fix the following coccicheck warning: > ./drivers/fsi/fsi-master-gpio.c:721:8-16:WARNING:use scnprintf or > sprintf Looks good, but we may as well do the other cases (in fsi-core) at the same time. There's a cocci script in the initial sysfs_emit series: https://lore.kernel.org/lkml/c22b7006813b1776467a72e716a5970e9277b4b7.camel@perches.com/ Which gives me these additional changes: diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c index 59ddc9fd5bca..159db87a043d 100644 --- a/drivers/fsi/fsi-core.c +++ b/drivers/fsi/fsi-core.c @@ -818,7 +818,7 @@ static ssize_t slave_send_echo_show(struct device *dev, { struct fsi_slave *slave = to_fsi_slave(dev); - return sprintf(buf, "%u\n", slave->t_send_delay); + return sysfs_emit(buf, "%u\n", slave->t_send_delay); } static ssize_t slave_send_echo_store(struct device *dev, @@ -862,7 +862,7 @@ static ssize_t chip_id_show(struct device *dev, { struct fsi_slave *slave = to_fsi_slave(dev); - return sprintf(buf, "%d\n", slave->chip_id); + return sysfs_emit(buf, "%d\n", slave->chip_id); } static DEVICE_ATTR_RO(chip_id); @@ -873,7 +873,7 @@ static ssize_t cfam_id_show(struct device *dev, { struct fsi_slave *slave = to_fsi_slave(dev); - return sprintf(buf, "0x%x\n", slave->cfam_id); + return sysfs_emit(buf, "0x%x\n", slave->cfam_id); } static DEVICE_ATTR_RO(cfam_id); Do you want to include these in your patch too? Cheers, Jeremy