mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Evgeniy Polyakov <zbr@ioremap.net>
To: Colin King <colin.king@canonical.com>
Cc: "kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] w1: remove redundant assignments to search_bit and last_rn
Date: Wed, 06 Dec 2017 01:34:15 +0300	[thread overview]
Message-ID: <803221512513255@web55j.yandex.ru> (raw)
In-Reply-To: <20171107184914.7561-1-colin.king@canonical.com>

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

      reply	other threads:[~2017-12-05 22:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-07 18:49 Colin King
2017-12-05 22:34 ` Evgeniy Polyakov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=803221512513255@web55j.yandex.ru \
    --to=zbr@ioremap.net \
    --cc=colin.king@canonical.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®