Skip to content

Commit

Permalink
iio: light: Convert sysfs sprintf/snprintf family to sysfs_emit
Browse files Browse the repository at this point in the history
Fix the following coccicheck warning:
drivers/iio/light/veml6030.c:131:8-16: WARNING:
use scnprintf or sprintf

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Link: https://lore.kernel.org/r/1618216751-1678-3-git-send-email-tiantao6@hisilicon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  • Loading branch information
Tian Tao authored and Jonathan Cameron committed May 17, 2021
1 parent 643adb9 commit c79859b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iio/light/veml6030.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static ssize_t in_illuminance_period_available_show(struct device *dev,
return -EINVAL;
}

return snprintf(buf, PAGE_SIZE, "%s\n", period_values[x]);
return sysfs_emit(buf, "%s\n", period_values[x]);
}

static IIO_DEVICE_ATTR_RO(in_illuminance_period_available, 0);
Expand Down

0 comments on commit c79859b

Please sign in to comment.