diff options
| author | Qing Wang <[email protected]> | 2021-10-18 08:00:36 +0000 |
|---|---|---|
| committer | Mauro Carvalho Chehab <[email protected]> | 2021-11-15 08:11:34 +0000 |
| commit | 2a998392403f746e9320c3b836303f8720651e5c (patch) | |
| tree | be672b14cb635fd0892b33ebce310aae28196ec1 /drivers/media/i2c/ccs/ccs-core.c | |
| parent | media: ipu3-cio2: fix error code in cio2_bridge_connect_sensor() (diff) | |
| download | kernel-2a998392403f746e9320c3b836303f8720651e5c.tar.gz kernel-2a998392403f746e9320c3b836303f8720651e5c.zip | |
media: i2c: ccs: replace snprintf in show functions with sysfs_emit
show() should not use snprintf() when formatting the value to be
returned to user space.
Fix the following coccicheck warning:
drivers/media/i2c/ccs/ccs-core.c:3761: WARNING: use scnprintf or sprintf.
Signed-off-by: Qing Wang <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Diffstat (limited to 'drivers/media/i2c/ccs/ccs-core.c')
| -rw-r--r-- | drivers/media/i2c/ccs/ccs-core.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c index 5363f3bcafe3..9158d3ce45c0 100644 --- a/drivers/media/i2c/ccs/ccs-core.c +++ b/drivers/media/i2c/ccs/ccs-core.c @@ -2758,13 +2758,13 @@ ident_show(struct device *dev, struct device_attribute *attr, char *buf) struct ccs_module_info *minfo = &sensor->minfo; if (minfo->mipi_manufacturer_id) - return snprintf(buf, PAGE_SIZE, "%4.4x%4.4x%2.2x\n", - minfo->mipi_manufacturer_id, minfo->model_id, - minfo->revision_number) + 1; + return sysfs_emit(buf, "%4.4x%4.4x%2.2x\n", + minfo->mipi_manufacturer_id, minfo->model_id, + minfo->revision_number) + 1; else - return snprintf(buf, PAGE_SIZE, "%2.2x%4.4x%2.2x\n", - minfo->smia_manufacturer_id, minfo->model_id, - minfo->revision_number) + 1; + return sysfs_emit(buf, "%2.2x%4.4x%2.2x\n", + minfo->smia_manufacturer_id, minfo->model_id, + minfo->revision_number) + 1; } static DEVICE_ATTR_RO(ident); |
