From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADC24C433F5 for ; Thu, 14 Oct 2021 06:40:56 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 687E361029 for ; Thu, 14 Oct 2021 06:40:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 687E361029 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RyLFcwRsrveBSavjRryZAIyy2BDNyVddMQIwut2g3uc=; b=xc40+y2vp16fxKN46rG8OCOZFb G2OKXXQ5RKJoaIYSUlb17Dk2TCQb8aCox28Lv/c/Fap3GMmcF39j7Dk2D43dT+wYiFQenLbSQ6nPf yhlQXlPpv7lbMdQOULFYYiBLkiCo5NXVHlE4wdZQUvV9PEOANfYayLpokjekeXzdP8a0w8IWAaHGt S07EiRZphSpG/ECB5H8fI2THaZipk4MG77PwF8ROZyMxqBcLuudcTfumC/Gf7wyVSWZX8Psr+jvWE fdYZF4VLwhofSjt1Ubz1uCM2nmDpqesd1c4UUP5pEpaMZyooe94IJSQMbiV4fEVD3alb5WGk/ov81 k6fGbu6A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mauOA-001j1o-Mn; Thu, 14 Oct 2021 06:38:50 +0000 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mauO6-001j0B-S4 for linux-arm-kernel@lists.infradead.org; Thu, 14 Oct 2021 06:38:48 +0000 Received: by mail-pg1-x536.google.com with SMTP id q5so4583062pgr.7 for ; Wed, 13 Oct 2021 23:38:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=0yvGAdlGwGjmIyVzlCTH27Niw9ewJoOJO9bhBri9ypA=; b=eT60p1AkePaLtDwuzgcfn7CjUMUZJZ2jz79ThxLTJFLdKYKpSSjImi+t6K1d8UZsVn uh8juQTXYfJASrN8UFVn9HENYga/fwSoWafGhwR6nGEMzEXz+sAPdLnpD2nXqQrpYJEM XF3i188QUXOui+Lw5tZFrhVNxN80QpTyvN8nypoLdc2iuJHLrsC/RbflIODKY5MA3eBr KhSE0ymdhusVh/aZMmax8X5D8//UQ1DzvuvnQCNqPMmy1zg4Zsx+28MdA1ZHOItAPztO o6xGPPcoZs3S37j2KbGLhkVlDF5TF49BUfuG3m+bl6Z9by7R2iZgXUrrJRXZdKvlDbX5 s9IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=0yvGAdlGwGjmIyVzlCTH27Niw9ewJoOJO9bhBri9ypA=; b=zDcT1JaPBwsyEmWmHnHYHb5XaE7frxGt50L+NFCOWz2NfeiWbBUFF7uAHqt4N8h8os xFzro8FiVk7k59qL+u2LWFYOk/TRdEW+fizwP22iSPR6y5CGRJGl5kjXyEPn44j93NKp i0q+qw7u/uEJXijdF14iufWXXI0c118bbbWliuVq56SdL9ulJbokVYgKNjbm3dX8zJB7 3xa7qIpb4rd9nwbV1vvzgkeapM5veaMBxV9yiuTJUbOqv5gN3+28BFaznj81utq0KKsU DIYbX72e3EG+ig8KQqfOCYrFPIxoePnkEYxJFKR/8Lix4QK605zo0T1HL9U2c3dE4xPq et1Q== X-Gm-Message-State: AOAM533XzB6MmaMU8WUsNOt4SJdMP4GxMqRtI/dChAkQJhwB+4/SHuEg jAFU+V0f86iQ7zVdbM1+ZQY= X-Google-Smtp-Source: ABdhPJztN0xFF3yKFMz/iJDeoME1t7GYr6HJYejtr0V32bNkr135zb/V7OOaeOdel1mLvwEq9lSfdw== X-Received: by 2002:a63:3748:: with SMTP id g8mr2923207pgn.102.1634193524819; Wed, 13 Oct 2021 23:38:44 -0700 (PDT) Received: from shinobu ([156.146.35.76]) by smtp.gmail.com with ESMTPSA id s2sm1379433pgd.13.2021.10.13.23.38.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 23:38:44 -0700 (PDT) Date: Thu, 14 Oct 2021 15:38:39 +0900 From: William Breathitt Gray To: Qing Wang Cc: Fabrice Gasnier , Maxime Coquelin , Alexandre Torgue , linux-iio@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] counter: replace snprintf in show functions with sysfs_emit Message-ID: References: <1634095619-4174-1-git-send-email-wangqing@vivo.com> MIME-Version: 1.0 In-Reply-To: <1634095619-4174-1-git-send-email-wangqing@vivo.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211013_233846_953536_FAB024B7 X-CRM114-Status: GOOD ( 20.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============2876784888583856578==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============2876784888583856578== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="/acL0IA0evwDpukR" Content-Disposition: inline --/acL0IA0evwDpukR Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 12, 2021 at 08:26:59PM -0700, Qing Wang wrote: > coccicheck complains about the use of snprintf() in sysfs show functions. >=20 > Fix the following coccicheck warning: > drivers/counter/stm32-lptimer-cnt.c:265:8-16: WARNING: use scnprintf or s= printf. > drivers/counter/stm32-lptimer-cnt.c:176:8-16: WARNING: use scnprintf or s= printf. >=20 > Use sysfs_emit instead of scnprintf or sprintf makes more sense. >=20 > Signed-off-by: Qing Wang Hello Qing Wang, Thank you for your submission. I believe these warnings are already resolved by commit d70e46af7531 ("counter: Internalize sysfs interface code") in the linux-next tree. Would you verify whether that is the case or if we still need to fix this? Sincerely, William Breathitt Gray > --- > drivers/counter/stm32-lptimer-cnt.c | 2 +- > drivers/counter/stm32-timer-cnt.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/counter/stm32-lptimer-cnt.c b/drivers/counter/stm32-= lptimer-cnt.c > index c19d998..6f1113a 100644 > --- a/drivers/counter/stm32-lptimer-cnt.c > +++ b/drivers/counter/stm32-lptimer-cnt.c > @@ -262,7 +262,7 @@ static ssize_t stm32_lptim_cnt_ceiling_read(struct co= unter_device *counter, > { > struct stm32_lptim_cnt *const priv =3D counter->priv; > =20 > - return snprintf(buf, PAGE_SIZE, "%u\n", priv->ceiling); > + return sysfs_emit(buf, "%u\n", priv->ceiling); > } > =20 > static ssize_t stm32_lptim_cnt_ceiling_write(struct counter_device *coun= ter, > diff --git a/drivers/counter/stm32-timer-cnt.c b/drivers/counter/stm32-ti= mer-cnt.c > index 603b30a..e772586 100644 > --- a/drivers/counter/stm32-timer-cnt.c > +++ b/drivers/counter/stm32-timer-cnt.c > @@ -173,7 +173,7 @@ static ssize_t stm32_count_ceiling_read(struct counte= r_device *counter, > =20 > regmap_read(priv->regmap, TIM_ARR, &arr); > =20 > - return snprintf(buf, PAGE_SIZE, "%u\n", arr); > + return sysfs_emit(buf, "%u\n", arr); > } > =20 > static ssize_t stm32_count_ceiling_write(struct counter_device *counter, > --=20 > 2.7.4 >=20 --/acL0IA0evwDpukR Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEk5I4PDJ2w1cDf/bghvpINdm7VJIFAmFn0GIACgkQhvpINdm7 VJLiwxAAuzG/hybrpcaFNKO86nfLbe6lfxCeppv2YSTC+n8uuTMaltvBqX7+y5Vo HLpnhgSqSQnBUy9lHzILySxYhgMEWjnoWKwakwmk1JMMV6odHcnCQZT5dgs+zihZ UJqk4iKIZkhWdCxVF/BBtiPSrIvUE+NyJr+GSBwRrWofyiAfl3leI0fURiNscpPZ tZGZqQ4wL2H46QowHRpXeK7jkg7S97v5llXJPnHjvVsaBVAfEs1wH0Qcv95eMV3M YeZKe+4I7bne7k65821EkChZdVWBwXgJtefT9mLqmOBxt8B5Bl4YVFvFxpbKU+cX XIUSq4pod6ywfBHTIUG3F9uD8/rNU9nGvYOLWxdD2wpFu16eFtJ0j6GIxzmEvEi4 wuH34aNLuyx62/MGwmnq3Z55SszgzgfxmTCHQetPajLgryV8m+4iTA+AVthtwVjA 6RL53DX3IhYNINspBdU0JcZcEGMlq8k33t6aBWnUxyv/4dBIdczIBH9lJJnyEUbQ K9WnWLrj6e2/2IIJZAmVk8hSaMfm2+R0QvrZrGugK8k7JlWt1QGLkLyE2R5pfJvh +CifKG7/hFrSEABvzi2TPjL3FHFR7XVRcPqV/AnfsvVKSbohx86mDymqwdXbad18 5PsGTsXrSCrZkC2pLBoyydMP4OtMxEqQPgcr1Uvzj0vIkUJXKIg= =bXhQ -----END PGP SIGNATURE----- --/acL0IA0evwDpukR-- --===============2876784888583856578== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============2876784888583856578==--