RE: [PATCH] scsi: snic: Convert snprintf to scnprintf

From: David Laight
Date: Fri Jul 14 2023 - 10:56:38 EST


From: hanyu001@xxxxxxxxxx
> Sent: 12 July 2023 11:16
>
> Coccinelle reports a warning:
>
> drivers/scsi/snic/snic_attrs.c:35: WARNING: use scnprintf or sprintf
> drivers/scsi/snic/snic_attrs.c:48: WARNING: use scnprintf or sprintf
> drivers/scsi/snic/snic_attrs.c:26: WARNING: use scnprintf or sprintf:

The function you are looking for is (probably) sysfs_emit().

The PAGE_SIZE constant ought to be a good hint that neither
sprintf, snprintf or scnprintf is actually right.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)