Re: [PATCH 1/3] conf_match(): Remove dead code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

> From: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx>
> 
> devname is always NULL, hence if () statement will always fail.
> 
> Signed-off-by: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx>
> ---
>  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: signature.asc
Description: PGP signature


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux