lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <54C96DA4.10509@cray.com>
Date:	Wed, 28 Jan 2015 17:15:48 -0600
From:	Frank Zago <fzago@...y.com>
To:	Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>,
	Oleg Drokin <oleg.drokin@...el.com>,
	Andreas Dilger <andreas.dilger@...el.com>
CC:	<devel@...verdev.osuosl.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	<linux-kernel@...r.kernel.org>, <HPDD-discuss@...ts.01.org>,
	Eddie Kovsky <ewk@...ovsky.org>, Anil Belur <askb23@...il.com>
Subject: Re: [HPDD-discuss] [PATCH] staging: lustre: fid: lproc_fid: Removed
 variables that is never used

On 01/28/2015 04:46 PM, Rickard Strandqvist wrote:
> Variable ar assigned a value that is never used.

s/ar/rc/

> I have also removed all the code that thereby serves no purpose.
>
> This was found using a static code analysis program called cppcheck
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
> ---
>   drivers/staging/lustre/lustre/fid/lproc_fid.c |    3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/staging/lustre/lustre/fid/lproc_fid.c b/drivers/staging/lustre/lustre/fid/lproc_fid.c
> index 6a21f07..feb7425 100644
> --- 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",

I would test rc instead:
   if (rc != 2)
        return -EINVAL;

Regards,
   Frank.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ