Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1362919lqt; Wed, 20 Mar 2024 01:12:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVUAhPymTmCOkm/eZGhBVeLvvWX7UOWzkFQvy3mg5dUeYvr0nuS3GcEVQUGgqhAiIyS6KMJWpN7H0OK0CCO2gWtylkeJEStgmnz3D7lPA== X-Google-Smtp-Source: AGHT+IGC1KQAw/t2pRJ/fKJQ0A7TII03BzulPUWltCKLH2APnQJrrOOj/bbn+hnVrsG8ucymtcWY X-Received: by 2002:a05:6402:414c:b0:568:b4b7:3172 with SMTP id x12-20020a056402414c00b00568b4b73172mr933048eda.6.1710922377301; Wed, 20 Mar 2024 01:12:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710922377; cv=pass; d=google.com; s=arc-20160816; b=wyAno5za6OACisQYlUFBJbx4piJifg+ksvRbnd7jRTBxAurHsrXTnoh+N1FICdCE1g y8LbsKy9odXQNsQ3fKb8vMQbTKFaultFv0NemI6ZRTgGO1Bf5yQt7HTia5iWKs4FTXar s5aRJmFgBuy0cdhwKjn2QRGtb8Nk4sG/8YRoK89PTTNxzuXcDiJcDdFlQCoe6p6ZiwZS b9yyHiBhjNbks/cKXyYCxcjLlMC8T76l9BrrNXM/f4Y6a6PnsALvN/Azwu4VtmoWvJ1h cGl9rivc5bfVZrSQib/9/VQ626sqFxNTNhljCnZ49j0djB97ExKwFzKi1hKJ4XdXNuxi aHdg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:in-reply-to:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :date:message-id:dkim-signature; bh=qi698Fr0cK/LGYkHXD/4rGactapeAbDOhymD1DLW/A0=; fh=gNg+YZstQ7pJBsaMGuJUvkcDjm5TJJUtMFsCaeTWNJ8=; b=kvGFpkPNDVhNjzA+mbOcOGIiQODa8WkyTipaQi+xofv896HATc5oxdok5fJG47AfPn OLL0fYjdTXAbNecNGFr0MCG8R9JisRSnhjT2wFkRuboOSPDMHryHM+tdlJ9pYcdm/pbv 1xgFyU81I6Dnls7BdQA3NGBt4jAn5Wgejm7Ei9IrDcA6kzgoRJKjpI3jB8ySpT9ESVuL Z+UTwPlo1tQHjCDPiuAVt3pm8KIWCRvlz4GBSjMD6rzoSZIsP/J2vJtpbWMGzpdzLmGv +2QQ1tYP4h8OY/AItBuFaTEtqKnZ1ETE4PbdfyZPcnO7NcSc5oL22CaTY+Blckujco9h H3Zg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=YJXieyJr; arc=pass (i=1 spf=pass spfdomain=gmx.de dkim=pass dkdomain=gmx.de dmarc=pass fromdomain=gmx.de); spf=pass (google.com: domain of linux-kernel+bounces-108599-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108599-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id g16-20020a056402321000b0056b9fe9c311si1023017eda.220.2024.03.20.01.12.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 01:12:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-108599-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=YJXieyJr; arc=pass (i=1 spf=pass spfdomain=gmx.de dkim=pass dkdomain=gmx.de dmarc=pass fromdomain=gmx.de); spf=pass (google.com: domain of linux-kernel+bounces-108599-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108599-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de 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 am.mirrors.kernel.org (Postfix) with ESMTPS id D03211F23858 for ; Wed, 20 Mar 2024 08:12:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F39C92C86A; Wed, 20 Mar 2024 08:12:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=deller@gmx.de header.b="YJXieyJr" Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (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 7A69F2C85A; Wed, 20 Mar 2024 08:12:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710922368; cv=none; b=ZeH826Y55+rJLC1zIqhAD2jDWqEnfOnZQYyJfQcG3cBT8lWvwRCOdd72BQp8uy9h3Z2c9tD3lal1wrxhr++U62/ogPlg7J3VlZODIyCbhhX7Jd5auCJUiC1YgEy5iR7NWZ6JBPCAditJPooPTsgrJz2KvNc5/rOWfLBluvOwXHs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710922368; c=relaxed/simple; bh=JcNzj/0EtMHAtn14gq4mUAgKfkqyj8QlY/dSVFHL1z8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=pdYAGtNimUWdWIH/XaiwSuOhF4djFy4rr8c01rVfgzsWtSF/RzDEHneVtfYkHbGx1V2vN3BGELGsDU8qDtiMhLMpE+9fo5FMME+V5z/q7HaIKHLl2ukDbTmkTte/m4VVls8jHiHLDqrIIZqJDlg92z6escu/5PGmeVzR/h7Oa5A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=deller@gmx.de header.b=YJXieyJr; arc=none smtp.client-ip=212.227.15.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1710922360; x=1711527160; i=deller@gmx.de; bh=qi698Fr0cK/LGYkHXD/4rGactapeAbDOhymD1DLW/A0=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From: In-Reply-To; b=YJXieyJruFzfF6yXeMG/LMaNhuXrfojPYvhJ9bKeGu5ARuhbCaP1/zwlfSsDEkSc /oCK0Zyc6/9LYZGL5eXbw24g6YHA703ja33yJCpLkYywtbNKGS/hy9x3wljaJK6ni 9ZX7/NUpW/WybXzj2I64xKdU0/+apGafuSb9QrA2Jd+HrQmctwccqSOsW5IKDFMSf gHTctUbOGcgbPDmRtZXFBHdMLvNFDOWXHZzToEJASUCNRuXLr0S2LHS3RpBu3omaR dNsMczh3gOmULuayqFPaFI04JAMhLz4u0Rehp6A1jMuIvu8X6QEBNCdu1BgwIJ4Jl ot4jKB7RLhmCLHybeA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.20.55] ([94.134.145.175]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MDysg-1rfC5E1Ieq-00A0yq; Wed, 20 Mar 2024 09:12:40 +0100 Message-ID: <6cef8e77-dca8-4c8f-9af5-62586578609a@gmx.de> Date: Wed, 20 Mar 2024 09:12:39 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] video: fbdev: panel-tpo-td043mtea1: Convert sprintf() family to sysfs_emit() family Content-Language: en-US To: Li Zhijian , linux-kernel@vger.kernel.org Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org References: <20240319092333.1590322-1-lizhijian@fujitsu.com> From: Helge Deller Autocrypt: addr=deller@gmx.de; keydata= xsFNBF3Ia3MBEAD3nmWzMgQByYAWnb9cNqspnkb2GLVKzhoH2QD4eRpyDLA/3smlClbeKkWT HLnjgkbPFDmcmCz5V0Wv1mKYRClAHPCIBIJgyICqqUZo2qGmKstUx3pFAiztlXBANpRECgwJ r+8w6mkccOM9GhoPU0vMaD/UVJcJQzvrxVHO8EHS36aUkjKd6cOpdVbCt3qx8cEhCmaFEO6u CL+k5AZQoABbFQEBocZE1/lSYzaHkcHrjn4cQjc3CffXnUVYwlo8EYOtAHgMDC39s9a7S90L 69l6G73lYBD/Br5lnDPlG6dKfGFZZpQ1h8/x+Qz366Ojfq9MuuRJg7ZQpe6foiOtqwKym/zV dVvSdOOc5sHSpfwu5+BVAAyBd6hw4NddlAQUjHSRs3zJ9OfrEx2d3mIfXZ7+pMhZ7qX0Axlq Lq+B5cfLpzkPAgKn11tfXFxP+hcPHIts0bnDz4EEp+HraW+oRCH2m57Y9zhcJTOJaLw4YpTY GRUlF076vZ2Hz/xMEvIJddRGId7UXZgH9a32NDf+BUjWEZvFt1wFSW1r7zb7oGCwZMy2LI/G aHQv/N0NeFMd28z+deyxd0k1CGefHJuJcOJDVtcE1rGQ43aDhWSpXvXKDj42vFD2We6uIo9D 1VN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aAXnqYK3/yWf FwRDcGV6nxanxZGKEkSHHOm8jHwvQWvPP73pvuPBEPtKGLzbgd7OOcGZWtq2hNC6cRtsRdDx 4TAGMCz4j238m+2mdbdhRh3iBnWT5yPFfnv/2IjFAk+sdix1Mrr+LIDF++kiekeq0yUpDdc4 ExBy2xf6dd+tuFFBp3/VDN4U0UfG4QJ2fg19zE5Z8dS4jGIbLg== In-Reply-To: <20240319092333.1590322-1-lizhijian@fujitsu.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:DLWcJwmNZ97AysVmjGiBxzRfzOzprNYeT4qnhhw4Xji4rUuvAzV 7J7beNhn9NVGOhZUH/mR+dccYsWTIkZTb0ChZK2h8c+J/vXnxoCBYjOt1FNx74rF6YhRL0U ylUbB4rmSlRnPe8qdx8Kwh25np6b+DgHnEdjRDENKL1qkJtsOXxtS8SlExalHQAa5aVLdTp cxCVi4xrFD20tlZ2ct14g== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:rXL+fvDm1co=;ZBP+SfNavm5a+fpFx63zYFa3BC+ OrqwBCMFT1cuu8t2mA81YX38gjPRPNIfYqXileQLaQEhKUoSWbiJqkTx3AKJjX78e+W+LhkPR zVXYX0qJKWBLTK8qiwSh1HvXXbw0A537dARGLdugz74ZoIvyWnOv5wX3gzZ9jJucbZLgHdPnb yh5+oU+6/etSy2fVZQFnAEE9S9xZv563K9Kht+zw+nD2RXC0E3hyBEMv4CljigWPU7yKmrXb4 Oc9ABkOZorhfHwksDvbLvLpUcUNJtIJPWGPn+zhLFIdCzax32WXfu/z/MT0wmlgnqxSCpwNTe kKAITUVVmNACKxtOhh/3X0B1dqggCq85LeXJGUpz4Jgrw0dD1zbCFt3lDLBraLsmn6NcCzRk/ nqI8YsAHqX+ldUS06ltdd31xCia+ra0XrZmicz/v3t4qxv6vW/LDr9hwMZ4VVxrwtcBApN35F tLDJy428LSW8UiboN5IVTniKhOOxrvmswHsY0idJso5tZsQleSHDTe87ybc3ibTOp0i7Otfso BxnF21XYPVNYgfoQZVPETxR97re/t2N1+SaPeBpy3WaUFL9Qx1vdo7RbHQ776Rm/QOlpAdFmd /GJDlZTZllGokzRFeGXljPlxsSAEFKhowTiZzhA0Mr/mxJL3RTfQD+2PcX53bPlo0W9NsWkKC /qw/GM2CiB+vbguBLbmc0ksUz4ULmVmty3Ru87gYt6dPcJ3FLShy6BEQJomYyGyvKMvbODyH3 gLvkouADIqtog5zUTJbPs8CYQv955JNOLaJlp8dCfHXkxxpmM1893QTFAHA0o/jVBAbdUfCX8 POIU6mv4I12EkgyWCBHycFIEVaUFs2Ri3vJvZf1SFPPLk= On 3/19/24 10:23, Li Zhijian wrote: > Per filesystems/sysfs.rst, show() should only use sysfs_emit() > or sysfs_emit_at() when formatting the value to be returned to user spac= e. > > coccinelle complains that there are still a couple of functions that use > snprintf(). Convert them to sysfs_emit(). > > sprintf() and scnprintf() will be converted as well if they have. > > Generally, this patch is generated by > make coccicheck M=3D MODE=3Dpatch \ > COCCI=3Dscripts/coccinelle/api/device_attr_show.cocci > > No functional change intended > > CC: Helge Deller > CC: linux-omap@vger.kernel.org > CC: linux-fbdev@vger.kernel.org > CC: dri-devel@lists.freedesktop.org > Signed-off-by: Li Zhijian applied to fbdev git tree. Thanks! Helge > --- > V3: > split it from a mess of drm,fbdev, becuase they are not the same sub= system. > > V2: > Fix missing '+' before '=3D' in drivers/video/fbdev/omap2/omapfb/dis= plays/panel-tpo-td043mtea1.c > > This is a part of the work "Fix coccicheck device_attr_show warnings"[1] > Split them per subsystem so that the maintainer can review it easily > [1] https://lore.kernel.org/lkml/20240116041129.3937800-1-lizhijian@fuji= tsu.com/ > --- > .../omap2/omapfb/displays/panel-tpo-td043mtea1.c | 12 ++++-------- > 1 file changed, 4 insertions(+), 8 deletions(-) > > diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td043mt= ea1.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td043mtea1.c > index 477789cff8e0..3624452e1dd0 100644 > --- a/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td043mtea1.c > +++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td043mtea1.c > @@ -228,14 +228,10 @@ static ssize_t tpo_td043_gamma_show(struct device = *dev, > int ret; > int i; > > - for (i =3D 0; i < ARRAY_SIZE(ddata->gamma); i++) { > - ret =3D snprintf(buf + len, PAGE_SIZE - len, "%u ", > - ddata->gamma[i]); > - if (ret < 0) > - return ret; > - len +=3D ret; > - } > - buf[len - 1] =3D '\n'; > + for (i =3D 0; i < ARRAY_SIZE(ddata->gamma); i++) > + len +=3D sysfs_emit_at(buf, len, "%u ", ddata->gamma[i]); > + if (len) > + buf[len - 1] =3D '\n'; > > return len; > }