From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161055AbbBDRsm (ORCPT ); Wed, 4 Feb 2015 12:48:42 -0500 Received: from smtp105.iad3a.emailsrvr.com ([173.203.187.105]:50042 "EHLO smtp105.iad3a.emailsrvr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966657AbbBDRsj (ORCPT ); Wed, 4 Feb 2015 12:48:39 -0500 X-Sender-Id: abbotti@mev.co.uk Message-ID: <54D25B6C.6050406@mev.co.uk> Date: Wed, 04 Feb 2015 17:48:28 +0000 From: Ian Abbott User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0 MIME-Version: 1.0 To: Nicholas Mc Guire CC: H Hartley Sweeten , Greg Kroah-Hartman , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] staging: comedi: dt282x: condition with no effect - if identical to else References: <1423069354-12689-1-git-send-email-hofrat@osadl.org> In-Reply-To: <1423069354-12689-1-git-send-email-hofrat@osadl.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/02/15 17:02, Nicholas Mc Guire wrote: > The if and the else branch code are identical - so the condition has no > effect on the effective code - this patch removes the condition and the > duplicated code. > > Signed-off-by: Nicholas Mc Guire > --- > > v2: Review notes from Ian Abbott and Hartley Sweeten > confirm that the condition is not > needed and, as suggested, the misleading comment is completely removed. > > Patch was only compile tested for x86_64_defconfig + CONFIG_STAGING=y > CONFIG_COMEDI=m, COMEDI_ISA_DRIVERS=y, CONFIG_COMEDI_DT282X=m > > Patch is against 3.19.0-rc7 (localversion = -next-20150204) > > drivers/staging/comedi/drivers/dt282x.c | 9 +-------- > 1 file changed, 1 insertion(+), 8 deletions(-) > > diff --git a/drivers/staging/comedi/drivers/dt282x.c b/drivers/staging/comedi/drivers/dt282x.c > index 051dfb2..db21d21 100644 > --- a/drivers/staging/comedi/drivers/dt282x.c > +++ b/drivers/staging/comedi/drivers/dt282x.c > @@ -685,14 +685,7 @@ static int dt282x_ai_cmdtest(struct comedi_device *dev, > > err |= cfc_check_trigger_arg_is(&cmd->start_arg, 0); > > - if (cmd->scan_begin_src == TRIG_FOLLOW) { > - /* internal trigger */ > - err |= cfc_check_trigger_arg_is(&cmd->scan_begin_arg, 0); > - } else { > - /* external trigger */ > - /* should be level/edge, hi/lo specification here */ > - err |= cfc_check_trigger_arg_is(&cmd->scan_begin_arg, 0); > - } > + err |= cfc_check_trigger_arg_is(&cmd->scan_begin_arg, 0); > > err |= cfc_check_trigger_arg_min(&cmd->convert_arg, 4000); > > Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd. E-mail: )=- -=( Web: http://www.mev.co.uk/ )=-