Re: [PATCH] staging: lustre: fid: lproc_fid: Removed variables that is never used

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

 



On Wed, 2015-01-28 at 23:46 +0100, Rickard Strandqvist wrote:
> Variable ar assigned a value that is never used.
> I have also removed all the code that thereby serves no purpose.
[]
> diff --git a/drivers/staging/lustre/lustre/fid/lproc_fid.c b/drivers/staging/lustre/lustre/fid/lproc_fid.c
[]
> @@ -63,7 +63,6 @@ static int lprocfs_fid_write_common(const char __user *buffer, size_t count,
>  				    struct lu_seq_range *range)
>  {
>  	struct lu_seq_range tmp;
> -	int rc;
>  	char kernbuf[MAX_FID_RANGE_STRLEN];
>  
>  	LASSERT(range != NULL);
> @@ -82,7 +81,7 @@ static int lprocfs_fid_write_common(const char __user *buffer, size_t count,
>  	}
>  
>  	/* of the form "[0x0000000240000400 - 0x000000028000400]" */
> -	rc = sscanf(kernbuf, "[%llx - %llx]\n",
> +	sscanf(kernbuf, "[%llx - %llx]\n",
>  		    (unsigned long long *)&tmp.lsr_start,
>  		    (unsigned long long *)&tmp.lsr_end);
>  	if (!range_is_sane(&tmp) || range_is_zero(&tmp) ||

Better to make this test use rc rather than
ignore the return from sscanf

	if (rc != 2 || !range_is_sane(etc...))

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux