From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932281AbdABJDO (ORCPT ); Mon, 2 Jan 2017 04:03:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57548 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932092AbdABJDN (ORCPT ); Mon, 2 Jan 2017 04:03:13 -0500 Date: Mon, 2 Jan 2017 10:03:08 +0100 From: Benjamin Tissoires To: Colin King Cc: Dmitry Torokhov , Nick Dyer , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] input: synaptics-rmi4: check for non zero version logically dead code Message-ID: <20170102090308.GB5767@mail.corp.redhat.com> References: <20161220095649.7674-1-colin.king@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20161220095649.7674-1-colin.king@canonical.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 02 Jan 2017 09:03:13 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Dec 20 2016 or thereabouts, Colin King wrote: > From: Colin Ian King > > version is a u8, the check for version > 0 means that version can only > be zero, so the subsequent check for version != 0 is never true and > hence is redudant code and can be removed. > > Signed-off-by: Colin Ian King > --- Works for me: Reviewed-by: Benjamin Tissoires > drivers/input/rmi4/rmi_f34.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/input/rmi4/rmi_f34.c b/drivers/input/rmi4/rmi_f34.c > index 9774dfb..c3285ce 100644 > --- a/drivers/input/rmi4/rmi_f34.c > +++ b/drivers/input/rmi4/rmi_f34.c > @@ -441,8 +441,6 @@ static int rmi_f34_probe(struct rmi_function *fn) > /* v5 code only supported version 0, try V7 probe */ > if (version > 0) > return rmi_f34v7_probe(f34); > - else if (version != 0) > - return -ENODEV; > > f34->bl_version = 5; > > -- > 2.10.2 >