Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753859Ab0KTQPR (ORCPT ); Sat, 20 Nov 2010 11:15:17 -0500 Received: from 81-174-11-161.staticnet.ngi.it ([81.174.11.161]:34512 "EHLO mail.enneenne.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1750972Ab0KTQPQ (ORCPT ); Sat, 20 Nov 2010 11:15:16 -0500 Date: Sat, 20 Nov 2010 17:15:12 +0100 From: Rodolfo Giometti To: Alexander Gordeev Cc: linux-kernel@vger.kernel.org, "Nikita V. Youshchenko" , linuxpps@ml.enneenne.com, Tejun Heo Message-ID: <20101120161511.GD13356@enneenne.com> Mail-Followup-To: Alexander Gordeev , linux-kernel@vger.kernel.org, "Nikita V. Youshchenko" , linuxpps@ml.enneenne.com, Tejun Heo References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: GNU/Linux Device Drivers, Embedded Systems and Courses X-PGP-Key: gpg --keyserver keyserver.linux.it --recv-keys D25A5633 User-Agent: Mutt/1.5.20 (2009-06-14) X-SA-Exim-Connect-IP: 192.168.32.37 X-SA-Exim-Mail-From: giometti@enneenne.com Subject: Re: [PATCHv4 11/17] pps: simplify conditions a bit X-SA-Exim-Version: 4.2.1 (built Wed, 25 Jun 2008 17:14:11 +0000) X-SA-Exim-Scanned: Yes (on mail.enneenne.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1889 Lines: 50 On Thu, Nov 18, 2010 at 07:01:04PM +0300, Alexander Gordeev wrote: > Bitwise conjunction is distributive so we can simplify some conditions. > > Signed-off-by: Alexander Gordeev > --- > drivers/pps/kapi.c | 6 ++---- > 1 files changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/pps/kapi.c b/drivers/pps/kapi.c > index 54261c4..2bdfbed 100644 > --- a/drivers/pps/kapi.c > +++ b/drivers/pps/kapi.c > @@ -184,8 +184,7 @@ void pps_event(struct pps_device *pps, struct pps_event_time *ts, int event, > > /* Check the event */ > pps->current_mode = pps->params.mode; > - if ((event & PPS_CAPTUREASSERT) & > - (pps->params.mode & PPS_CAPTUREASSERT)) { > + if (event & pps->params.mode & PPS_CAPTUREASSERT) { > /* We have to add an offset? */ > if (pps->params.mode & PPS_OFFSETASSERT) > pps_add_offset(&ts_real, > @@ -199,8 +198,7 @@ void pps_event(struct pps_device *pps, struct pps_event_time *ts, int event, > > captured = ~0; > } > - if ((event & PPS_CAPTURECLEAR) & > - (pps->params.mode & PPS_CAPTURECLEAR)) { > + if (event & pps->params.mode & PPS_CAPTURECLEAR) { > /* We have to add an offset? */ > if (pps->params.mode & PPS_OFFSETCLEAR) > pps_add_offset(&ts_real, > -- > 1.7.2.3 > Acked-by: Rodolfo Giometti -- GNU/Linux Solutions e-mail: giometti@enneenne.com Linux Device Driver giometti@linux.it Embedded Systems phone: +39 349 2432127 UNIX programming skype: rodolfo.giometti Freelance ICT Italia - Consulente ICT Italia - www.consulenti-ict.it -- 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/