All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] w1: remove redundant assignments to search_bit and last_rn
@ 2017-11-07 18:49 ` Colin King
  0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2017-11-07 18:49 UTC (permalink / raw)
  To: Evgeniy Polyakov; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Variables search_bit and last_rn are assigned values before a while-loop
however these initial values are never read (as they are overwritten
inside the loop). Thus these initial assignments are redundant and can
be removed. Cleans up clang warnings:

drivers/w1/w1.c:967:2: warning: Value stored to 'search_bit' is never
read
drivers/w1/w1.c:969:2: warning: Value stored to 'last_rn' is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/w1/w1.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index 0c2a5a8327bd..c29f6c5dda3c 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -964,9 +964,7 @@ void w1_search(struct w1_master *dev, u8 search_type, w1_slave_found_callback cb
 	int search_bit, desc_bit;
 	u8  triplet_ret = 0;
 
-	search_bit = 0;
 	rn = dev->search_id;
-	last_rn = 0;
 	last_device = 0;
 	last_zero = -1;
 
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] w1: remove redundant assignments to search_bit and last_rn
@ 2017-11-07 18:49 ` Colin King
  0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2017-11-07 18:49 UTC (permalink / raw)
  To: Evgeniy Polyakov; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Variables search_bit and last_rn are assigned values before a while-loop
however these initial values are never read (as they are overwritten
inside the loop). Thus these initial assignments are redundant and can
be removed. Cleans up clang warnings:

drivers/w1/w1.c:967:2: warning: Value stored to 'search_bit' is never
read
drivers/w1/w1.c:969:2: warning: Value stored to 'last_rn' is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/w1/w1.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index 0c2a5a8327bd..c29f6c5dda3c 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -964,9 +964,7 @@ void w1_search(struct w1_master *dev, u8 search_type, w1_slave_found_callback cb
 	int search_bit, desc_bit;
 	u8  triplet_ret = 0;
 
-	search_bit = 0;
 	rn = dev->search_id;
-	last_rn = 0;
 	last_device = 0;
 	last_zero = -1;
 
-- 
2.14.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] w1: remove redundant assignments to search_bit and last_rn
  2017-11-07 18:49 ` Colin King
@ 2017-12-05 22:34   ` Evgeniy Polyakov
  -1 siblings, 0 replies; 4+ messages in thread
From: Evgeniy Polyakov @ 2017-12-05 22:34 UTC (permalink / raw)
  To: Colin King; +Cc: kernel-janitors, linux-kernel

Hi

07.11.2017, 21:49, "Colin King" <colin.king@canonical.com>:
> From: Colin Ian King <colin.king@canonical.com>
>
> Variables search_bit and last_rn are assigned values before a while-loop
> however these initial values are never read (as they are overwritten
> inside the loop). Thus these initial assignments are redundant and can
> be removed. Cleans up clang warnings:
>
> drivers/w1/w1.c:967:2: warning: Value stored to 'search_bit' is never
> read
> drivers/w1/w1.c:969:2: warning: Value stored to 'last_rn' is never read

This looks good, thank you.
Please pull it into janitors tree if you haven't yet.

> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Acked-by: Evgeniy Polyakov <zbr@ioremap.net>

> ---
>  drivers/w1/w1.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
> index 0c2a5a8327bd..c29f6c5dda3c 100644
> --- a/drivers/w1/w1.c
> +++ b/drivers/w1/w1.c
> @@ -964,9 +964,7 @@ void w1_search(struct w1_master *dev, u8 search_type, w1_slave_found_callback cb
>          int search_bit, desc_bit;
>          u8 triplet_ret = 0;
>
> - search_bit = 0;
>          rn = dev->search_id;
> - last_rn = 0;
>          last_device = 0;
>          last_zero = -1;
>
> --
> 2.14.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] w1: remove redundant assignments to search_bit and last_rn
@ 2017-12-05 22:34   ` Evgeniy Polyakov
  0 siblings, 0 replies; 4+ messages in thread
From: Evgeniy Polyakov @ 2017-12-05 22:34 UTC (permalink / raw)
  To: Colin King; +Cc: kernel-janitors, linux-kernel

Hi

07.11.2017, 21:49, "Colin King" <colin.king@canonical.com>:
> From: Colin Ian King <colin.king@canonical.com>
>
> Variables search_bit and last_rn are assigned values before a while-loop
> however these initial values are never read (as they are overwritten
> inside the loop). Thus these initial assignments are redundant and can
> be removed. Cleans up clang warnings:
>
> drivers/w1/w1.c:967:2: warning: Value stored to 'search_bit' is never
> read
> drivers/w1/w1.c:969:2: warning: Value stored to 'last_rn' is never read

This looks good, thank you.
Please pull it into janitors tree if you haven't yet.

> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Acked-by: Evgeniy Polyakov <zbr@ioremap.net>

> ---
>  drivers/w1/w1.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
> index 0c2a5a8327bd..c29f6c5dda3c 100644
> --- a/drivers/w1/w1.c
> +++ b/drivers/w1/w1.c
> @@ -964,9 +964,7 @@ void w1_search(struct w1_master *dev, u8 search_type, w1_slave_found_callback cb
>          int search_bit, desc_bit;
>          u8 triplet_ret = 0;
>
> - search_bit = 0;
>          rn = dev->search_id;
> - last_rn = 0;
>          last_device = 0;
>          last_zero = -1;
>
> --
> 2.14.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-12-05 22:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-07 18:49 [PATCH] w1: remove redundant assignments to search_bit and last_rn Colin King
2017-11-07 18:49 ` Colin King
2017-12-05 22:34 ` Evgeniy Polyakov
2017-12-05 22:34   ` Evgeniy Polyakov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.