linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Jes.Sorensen@redhat.com
Cc: linux-raid@vger.kernel.org, dledford@redhat.com
Subject: Re: [PATCH 1/3] conf_match(): Remove dead code
Date: Tue, 1 Nov 2011 13:33:31 +1100	[thread overview]
Message-ID: <20111101133331.21d4ebae@notabene.brown> (raw)
In-Reply-To: <1320069234-13112-2-git-send-email-Jes.Sorensen@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1724 bytes --]

On Mon, 31 Oct 2011 14:53:52 +0100 Jes.Sorensen@redhat.com wrote:

> From: Jes Sorensen <Jes.Sorensen@redhat.com>
> 
> devname is always NULL, hence if () statement will always fail.
> 
> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
> ---
>  config.c |    9 ---------
>  1 files changed, 0 insertions(+), 9 deletions(-)
> 
> diff --git a/config.c b/config.c
> index c0a6baa..b57ba50 100644
> --- a/config.c
> +++ b/config.c
> @@ -1023,7 +1023,6 @@ struct mddev_ident *conf_match(struct mdinfo *info, struct supertype *st)
>  {
>  	struct mddev_ident *array_list, *match;
>  	int verbose = 0;
> -	char *devname = NULL;
>  	array_list = conf_get_ident(NULL);
>  	match = NULL;
>  	for (; array_list; array_list = array_list->next) {
> @@ -1044,14 +1043,6 @@ struct mddev_ident *conf_match(struct mdinfo *info, struct supertype *st)
>  					array_list->devname);
>  			continue;
>  		}
> -		if (array_list->devices && devname &&
> -		    !match_oneof(array_list->devices, devname)) {
> -			if (verbose >= 2 && array_list->devname)
> -				fprintf(stderr, Name
> -					": Not a listed device for %s.\n",
> -					array_list->devname);
> -			continue;
> -		}
>  		if (array_list->super_minor != UnSet &&
>  		    array_list->super_minor != info->array.md_minor) {
>  			if (verbose >= 2 && array_list->devname)


Hi Jes,
 thanks for these 3 patches.
 In each case I chose to remove different code :-)

 In this case search_mdstat was nearly identical to conf_match, but uses the
 bits you removed.  So I unified the two.

 For the 'Kill' fix, I removed a different test on 'force' so that the printf
 that you removed could not actually be reached.

Thanks,
NeilBrown


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

  reply	other threads:[~2011-11-01  2:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-31 13:53 [PATCH 0/3] Remove dead code Jes.Sorensen
2011-10-31 13:53 ` [PATCH 1/3] conf_match(): " Jes.Sorensen
2011-11-01  2:33   ` NeilBrown [this message]
2011-11-01  6:22     ` Jes Sorensen
2011-10-31 13:53 ` [PATCH 2/3] conf_watch(): More dead code removal Jes.Sorensen
2011-10-31 13:53 ` [PATCH 3/3] Kill(): Remove redundant check and dead code Jes.Sorensen

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=20111101133331.21d4ebae@notabene.brown \
    --to=neilb@suse.de \
    --cc=Jes.Sorensen@redhat.com \
    --cc=dledford@redhat.com \
    --cc=linux-raid@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;
as well as URLs for NNTP newsgroup(s).