public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Cc: Oleg Drokin <oleg.drokin@intel.com>,
	Andreas Dilger <andreas.dilger@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Dmitry Eremin <dmitry.eremin@intel.com>,
	Eddie Kovsky <ewk@edkovsky.org>, Anil Belur <askb23@gmail.com>,
	HPDD-discuss@ml01.01.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: lustre: fid: lproc_fid: Removed variables that is never used
Date: Wed, 28 Jan 2015 17:22:46 -0800	[thread overview]
Message-ID: <1422494566.13127.25.camel@perches.com> (raw)
In-Reply-To: <1422485188-10994-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

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...))


      parent reply	other threads:[~2015-01-29  1:23 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 ` [HPDD-discuss] " Frank Zago
2015-01-29  1:22 ` Joe Perches [this message]

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=1422494566.13127.25.camel@perches.com \
    --to=joe@perches.com \
    --cc=HPDD-discuss@ml01.01.org \
    --cc=andreas.dilger@intel.com \
    --cc=askb23@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=dmitry.eremin@intel.com \
    --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