Re: [PATCH] mtd: core: Convert sysfs sprintf/snprintf family to sysfs_emit

Richard Weinberger
2021-04-12T06:50:26Z

Tian Tao,

----- Ursprüngliche Mail -----
> Von: "Tian Tao" <tiantao6@hisilicon.com>
> An: "Miquel Raynal" <miquel.raynal@bootlin.com>, "richard" <richard@nod.at>, "Vignesh Raghavendra" <vigneshr@ti.com>
> CC: "linux-mtd" <linux-mtd@lists.infradead.org>, "Tian Tao" <tiantao6@hisilicon.com>
> Gesendet: Montag, 12. April 2021 08:44:32
> Betreff: [PATCH] mtd: core: Convert sysfs sprintf/snprintf family to sysfs_emit

> Fix the following coccicheck warning:
> drivers/mtd/mtdcore.c:296:8-16: WARNING: use scnprintf or sprintf
> drivers/mtd/mtdcore.c:306:8-16: WARNING: use scnprintf or sprintf
> drivers/mtd/mtdcore.c:237:8-16: WARNING: use scnprintf or sprintf
> drivers/mtd/mtdcore.c:275:8-16: WARNING: use scnprintf or sprintf
> drivers/mtd/mtdcore.c:286:8-16: WARNING: use scnprintf or sprintf
> drivers/mtd/mtdcore.c:264:8-16: WARNING: use scnprintf or sprintf
> drivers/mtd/mtdcore.c:227:8-16: WARNING: use scnprintf or sprintf
> drivers/mtd/mtdcore.c:162:8-16: WARNING: use scnprintf or sprintf
> drivers/mtd/mtdcore.c:143:8-16: WARNING: use scnprintf or sprintf
> drivers/mtd/mtdcore.c:218:8-16: WARNING: use scnprintf or sprintf
> drivers/mtd/mtdcore.c:208:8-16: WARNING: use scnprintf or sprintf
> drivers/mtd/mtdcore.c:199:8-16: WARNING: use scnprintf or sprintf
> drivers/mtd/mtdcore.c:190:8-16: WARNING: use scnprintf or sprintf
> drivers/mtd/mtdcore.c:152:8-16: WARNING: use scnprintf or sprintf
> drivers/mtd/mtdcore.c:181:8-16: WARNING: use scnprintf or sprintf
> drivers/mtd/mtdcore.c:134:8-16: WARNING: use scnprintf or sprintf
> drivers/mtd/mtdcore.c:171:8-16: WARNING: use scnprintf or sprintf

see:
https://lore.kernel.org/linux-mtd/CAFLxGvxC4KtvtU2rza_aGx2RPONxr7XygUwXCDriYiCr8qN3qg@mail.gmail.com/

Please explain why a patch is needed and what it fixes.