Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161191AbbBDQkh (ORCPT ); Wed, 4 Feb 2015 11:40:37 -0500 Received: from hofr.at ([212.69.189.236]:38255 "EHLO mail.hofr.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161021AbbBDQkd (ORCPT ); Wed, 4 Feb 2015 11:40:33 -0500 Date: Wed, 4 Feb 2015 17:40:32 +0100 From: Nicholas Mc Guire To: Hartley Sweeten Cc: Ian Abbott , Nicholas Mc Guire , Greg Kroah-Hartman , "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH RFC] staging: comedi: dt282x: condition with no effect - if identical to else Message-ID: <20150204164032.GA22025@opentech.at> References: <1422967091-14798-1-git-send-email-hofrat@osadl.org> <54D0E572.7030607@mev.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2075 Lines: 51 On Wed, 04 Feb 2015, Hartley Sweeten wrote: > On Tuesday, February 03, 2015 8:13 AM, Ian Abbott wrote: > > On 03/02/15 12:38, 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 > >> --- > >> > >> The if and else branch are identical code thus the condition has no effect > >> > >> 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); > >> } > >> > > I think what that comment means is that it should allow scan_begin_arg > > to have various combinations of the CR_EDGE and CR_INVERT bits set. > > I.e. it ought to allow whatever combination of CR_EDGE and CR_INVERT > > better describes the nature of the external trigger signal, in addition > > to allowing the lazy default value 0. > > > > I don't know what the nature of the external trigger signal is, as I > > haven't seen the manual. I think Hartley might have seen one. > > According to the manual, the external trigger is not "programmable". It's > a Schmitt trigger input, enables on TTL logic low, with a 22K pullup. > > Since the 'scan_begin_arg' is not actually used for the analog input async > command, I think removing the comments completely is fine. Just change > the check to: > > err |= cfc_check_trigger_arg_is(&cmd->scan_begin_arg, 0); > thanks for that clarification - will fix it up and resend. thx! hofrat -- 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/