[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BN3PR0101MB1057365D27515C535A1384E4D01B0@BN3PR0101MB1057.prod.exchangelabs.com>
Date: Thu, 19 Nov 2015 17:03:05 +0000
From: Hartley Sweeten <HartleyS@...ionengravers.com>
To: Ian Abbott <abbotti@....co.uk>,
"driverdev-devel@...uxdriverproject.org"
<driverdev-devel@...uxdriverproject.org>
CC: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 1/8] staging: comedi: rearrange comedi_write() code
On Wednesday, November 18, 2015 10:55 AM, Ian Abbott wrote:
> Rearrange the code in `comedi_write()` to reduce the amount of
> indentation. The code never reiterates the `while` loop once `count`
> has become non-zero, so we can check that in the `while` condition to
> save an indentation level. (Note that `nbytes` has been checked to be
> non-zero before entering the loop, so we can remove that check.) Move
> the code that makes the subdevice "become non-busy" outside the `while`
> loop, using a new flag variable `become_nonbusy` to decide whether it
> needs to be done. This simplifies the wait queue handling so there is a
> single place where the task is removed from the wait queue, and we can
> remove the `on_wait_queue` flag variable.
>
> Signed-off-by: Ian Abbott <abbotti@....co.uk>
> ---
> drivers/staging/comedi/comedi_fops.c | 71 +++++++++++++++---------------------
> 1 file changed, 30 insertions(+), 41 deletions(-)
Ian,
Minor nit-pick...
[snip]
> -out:
> - if (on_wait_queue)
> - remove_wait_queue(&async->wait_head, &wait);
> + remove_wait_queue(&async->wait_head, &wait);
> set_current_state(TASK_RUNNING);
> + if (become_nonbusy && count == 0) {
It looks like 'count' will always be 0 here.
Regards
Hartley
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists