Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1545011 > unrolled thread

[PATCH] input: synaptics-rmi4: check for non zero version logically dead code

Started byColin King <colin.king@canonical.com>
First post2016-12-20 11:00 +0100
Last post2017-01-02 10:10 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] input: synaptics-rmi4: check for non zero version logically dead code Colin King <colin.king@canonical.com> - 2016-12-20 11:00 +0100
    Re: [PATCH] input: synaptics-rmi4: check for non zero version  logically dead code Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2017-01-02 10:10 +0100

#1545011 — [PATCH] input: synaptics-rmi4: check for non zero version logically dead code

FromColin King <colin.king@canonical.com>
Date2016-12-20 11:00 +0100
Subject[PATCH] input: synaptics-rmi4: check for non zero version logically dead code
Message-ID<sQpnb-3Uc-3@gated-at.bofh.it>
From: Colin Ian King <colin.king@canonical.com>

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 <colin.king@canonical.com>
---
 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

[toc] | [next] | [standalone]


#1549044 — Re: [PATCH] input: synaptics-rmi4: check for non zero version logically dead code

FromBenjamin Tissoires <benjamin.tissoires@redhat.com>
Date2017-01-02 10:10 +0100
SubjectRe: [PATCH] input: synaptics-rmi4: check for non zero version logically dead code
Message-ID<sV6MV-4B9-11@gated-at.bofh.it>
In reply to#1545011
On Dec 20 2016 or thereabouts, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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 <colin.king@canonical.com>
> ---

Works for me:
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>

>  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
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web