[<prev] [next>] [day] [month] [year] [list]
Message-ID: <SL2PR06MB308276FBCF5F54C435E85F53BDB99@SL2PR06MB3082.apcprd06.prod.outlook.com>
Date: Fri, 15 Oct 2021 10:12:42 +0000
From: 王擎 <wangqing@...o.com>
To: Bruno Prémont <bonbons@...ux-vserver.org>
CC: Jiri Kosina <jikos@...nel.org>,
Benjamin Tissoires <benjamin.tissoires@...hat.com>,
Stefan Achatz <erazor_de@...rs.sourceforge.net>,
Jonathan Cameron <jic23@...nel.org>,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
"linux-input@...r.kernel.org" <linux-input@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>
Subject: 回复: [PATCH] hid: replace snprintf in show functions with sysfs_emit
>> show() must not use snprintf() when formatting the value to be
>> returned to user space.
>>
>> Fix the coccicheck warnings:
>> WARNING: use scnprintf or sprintf.
>>
>> Use sysfs_emit instead of scnprintf or sprintf makes more sense.
>
>Looks good to me, but I have a few remarks:
>
>- No need to talk about "must not use" in detailled commit message.
> Mentioning introduction of the newish sysfs_emit() functions (in
> commit 2efc459d06f1630001e3984854848a5647086232 a Year ago) and thus
> switching over to those would be sufficient for code predating their
> introduction.
>
>- I'm wondering why picolcd_fb_update_rate_show() in
> drivers/hid/hid-picolcd_fb.c:446
> is not updated as well in this same patch.
> There scnprintf() calls should be replaced with sysfs_emit_at() calls
> according to the intent of this patch!
scnprintf is fine, but snprintf is WRONG used.
scnprintf() return the number of bytes printed into the buffer.
snprintf() returns the length the resulting string.
>
>- Not sure if the patch should be split into a 5-patch series with one
> patch per HID driver (each driver can be updated independently).
>
I will do this in V2.
Thanks,
Qing
>
>Acked-by: Bruno Prémont <bonbons@...ux-vserver.org>
> (for picolcd code)
Powered by blists - more mailing lists