From: Jackie Liu kstrtol() is the preferred way to parse a single integer from sysfs input. It also makes the !count check unnecessary since kstrtol() returns -EINVAL on empty or malformed strings. Signed-off-by: Jackie Liu --- block/disk-events.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/disk-events.c b/block/disk-events.c index b1680d6a1027..b6233b0d5575 100644 --- a/block/disk-events.c +++ b/block/disk-events.c @@ -372,7 +372,7 @@ static ssize_t disk_events_poll_msecs_store(struct device *dev, struct gendisk *disk = dev_to_disk(dev); long intv; - if (!count || !sscanf(buf, "%ld", &intv)) + if (kstrtol(buf, 10, &intv)) return -EINVAL; if (intv < 0 && intv != -1) -- 2.51.1