On 3/16/21 1:11 AM, Jay Fang wrote: > From: Zihao Tang <tangzihao1@xxxxxxxxxxxxx> > > Fix the following coccicheck warning: > > drivers/hwmon/ina2xx.c:313:8-16: WARNING: use scnprintf or sprintf > drivers/hwmon/ina2xx.c:453:8-16: WARNING: use scnprintf or sprintf > drivers/hwmon/ina2xx.c:484:8-16: WARNING: use scnprintf or sprintf > drivers/hwmon/ina2xx.c:540:8-16: WARNING: use scnprintf or sprintf > > Signed-off-by: Zihao Tang <tangzihao1@xxxxxxxxxxxxx> > Signed-off-by: Jay Fang <f.fangjian@xxxxxxxxxx> > --- > drivers/hwmon/ina2xx.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/hwmon/ina2xx.c b/drivers/hwmon/ina2xx.c > index ca97f9e..2c12395 100644 > --- a/drivers/hwmon/ina2xx.c > +++ b/drivers/hwmon/ina2xx.c > @@ -310,7 +310,7 @@ static ssize_t ina2xx_value_show(struct device *dev, > if (err < 0) > return err; > > - return snprintf(buf, PAGE_SIZE, "%d\n", > + return sysfs_emit(buf, "%d\n", > ina2xx_get_value(data, attr->index, regval)); Line length limit is now 100 columns. If you want to keep the line split anyway, please fix the alignment. Thanks, Guenter > } > > @@ -450,7 +450,7 @@ static ssize_t ina226_alarm_show(struct device *dev, > > alarm = (regval & BIT(attr->index)) && > (regval & INA226_ALERT_FUNCTION_FLAG); > - return snprintf(buf, PAGE_SIZE, "%d\n", alarm); > + return sysfs_emit(buf, "%d\n", alarm); > } > > /* > @@ -481,7 +481,7 @@ static ssize_t ina2xx_shunt_show(struct device *dev, > { > struct ina2xx_data *data = dev_get_drvdata(dev); > > - return snprintf(buf, PAGE_SIZE, "%li\n", data->rshunt); > + return sysfs_emit(buf, "%li\n", data->rshunt); > } > > static ssize_t ina2xx_shunt_store(struct device *dev, > @@ -537,7 +537,7 @@ static ssize_t ina226_interval_show(struct device *dev, > if (status) > return status; > > - return snprintf(buf, PAGE_SIZE, "%d\n", ina226_reg_to_interval(regval)); > + return sysfs_emit(buf, "%d\n", ina226_reg_to_interval(regval)); > } > > /* shunt voltage */ >