From: Frank Zago <fzago@cray.com>
To: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>,
Oleg Drokin <oleg.drokin@intel.com>,
Andreas Dilger <andreas.dilger@intel.com>
Cc: <devel@driverdev.osuosl.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
<linux-kernel@vger.kernel.org>, <HPDD-discuss@ml01.01.org>,
Eddie Kovsky <ewk@edkovsky.org>, Anil Belur <askb23@gmail.com>
Subject: Re: [HPDD-discuss] [PATCH] staging: lustre: fid: lproc_fid: Removed variables that is never used
Date: Wed, 28 Jan 2015 17:15:48 -0600 [thread overview]
Message-ID: <54C96DA4.10509@cray.com> (raw)
In-Reply-To: <1422485188-10994-1-git-send-email-rickard_strandqvist@spectrumdigital.se>
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@spectrumdigital.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.
next prev parent reply other threads:[~2015-01-29 2:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-28 22:46 [PATCH] staging: lustre: fid: lproc_fid: Removed variables that is never used Rickard Strandqvist
2015-01-28 23:15 ` Frank Zago [this message]
2015-01-29 1:22 ` Joe Perches
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=54C96DA4.10509@cray.com \
--to=fzago@cray.com \
--cc=HPDD-discuss@ml01.01.org \
--cc=andreas.dilger@intel.com \
--cc=askb23@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=ewk@edkovsky.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg.drokin@intel.com \
--cc=rickard_strandqvist@spectrumdigital.se \
/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