Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756668Ab3IFPUg (ORCPT ); Fri, 6 Sep 2013 11:20:36 -0400 Received: from mail-yh0-f41.google.com ([209.85.213.41]:37954 "EHLO mail-yh0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756539Ab3IFPUe (ORCPT ); Fri, 6 Sep 2013 11:20:34 -0400 Date: Fri, 6 Sep 2013 11:20:28 -0400 From: Tejun Heo To: Xie XiuQi Cc: Jonathan Cameron , Dmitry Torokhov , Dmitry Torokhov , Thomas Gleixner , Andres Salomon , Chris Ball , Jon Nettleton , Andrew Morton , Nadia Derbey , "linux-kernel@vger.kernel.org" , Li Bin Subject: Re: [PATCH 1/5] iio: adc: remove unnecessary work pending test Message-ID: <20130906152028.GA22763@mtj.dyndns.org> References: <5229B601.9090109@huawei.com> <5229B64A.1030304@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5229B64A.1030304@huawei.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1000 Lines: 34 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 > Cc: Tejun Heo Reviewed-by: Tejun Heo 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/