[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160916060718.GD13205@amd>
Date: Fri, 16 Sep 2016 08:07:18 +0200
From: Pavel Machek <pavel@....cz>
To: David Lechner <david@...hnology.com>
Cc: Jacek Anaszewski <j.anaszewski@...sung.com>,
Richard Purdie <rpurdie@...ys.net>,
linux-kernel@...r.kernel.org, linux-leds@...r.kernel.org,
Marcel Holtmann <marcel@...tmann.org>
Subject: Re: [PATCH v3] leds: Introduce userspace leds driver
Hi!
+static ssize_t uleds_read(struct file *file, char __user *buffer,
size_t count,
+ loff_t *ppos)
+{
+ struct uleds_device *udev = file->private_data;
+ ssize_t retval;
+
+ if (count == 0)
+ return 0;
+
+ if (count != 1)
+ return -EINVAL;
This is quite anti-social. You are free to return 1 byte on any read
(short read), but please allow reads with bigger buffers.
Thanks,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Powered by blists - more mailing lists