Re: [PATCH] s390: replace snprintf in show functions with sysfs_emit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2021-10-18 at 13:50 +0200, Vineeth Vijayan wrote:
> Acked-by: Vineeth Vijayan <vneethv@xxxxxxxxxxxxx>  
[]
> On Thu, 2021-10-14 at 23:50 -0700, Qing Wang wrote:
> > show() must not use snprintf() when formatting the value to be
> > returned to user space.
[]
> > diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
[]
> > @@ -731,7 +731,7 @@ static ssize_t dasd_ff_show(struct device *dev,
[]
> > -	return snprintf(buf, PAGE_SIZE, ff_flag ? "1\n" : "0\n");
> > +	return sysfs_emit(buf, ff_flag ? "1\n" : "0\n");

It's more common to use

	return sysfs_emit(buf, "%d\n", ff_flag);

> > @@ -773,7 +773,7 @@ dasd_ro_show(struct device *dev, struct
[]
> > -	return snprintf(buf, PAGE_SIZE, ro_flag ? "1\n" : "0\n");
> > +	return sysfs_emit(buf, ro_flag ? "1\n" : "0\n");

etc...





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux