Re: [PATCH 1/5] iio: adc: remove unnecessary work pending test

From: Tejun Heo
Date: Fri Sep 06 2013 - 11:20:40 EST


On Fri, Sep 06, 2013 at 07:02:34PM +0800, Xie XiuQi wrote:
> Remove unnecessary work pending test before calling schedule_work().
> It has been tested in queue_work_on() already. No functional changed.
>
> Signed-off-by: Xie XiuQi <xiexiuqi@xxxxxxxxxx>
> Cc: Tejun Heo <tj@xxxxxxxxxx>

Reviewed-by: Tejun Heo <tj@xxxxxxxxxx>

One nit below tho.

> - if (iio_buffer_enabled(indio_dev)) {
> - if (!work_pending(&st->poll_work))
> - schedule_work(&st->poll_work);
> - } else {
> + if (iio_buffer_enabled(indio_dev))
> + schedule_work(&st->poll_work);
> + else {
> st->done = true;
> wake_up_interruptible(&st->wq_data_avail);
> }

Please don't drop the parentheses. The convention is to have either
both or none on if/else.

Thanks.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/