linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: ira.weiny@intel.com
Cc: devel@driverdev.osuosl.org, gregkh@linuxfoundation.org,
	dledford@redhat.com, dennis.dalessandro@intel.com,
	linux-rdma@vger.kernel.org
Subject: Re: [PATCH 5/8] staging/rdma/hfi1: return early if setlink state was specified
Date: Wed, 11 Nov 2015 12:06:07 +0300	[thread overview]
Message-ID: <20151111090607.GD18797@mwanda> (raw)
In-Reply-To: <1447220589-9067-6-git-send-email-ira.weiny@intel.com>

On Wed, Nov 11, 2015 at 12:43:06AM -0500, ira.weiny@intel.com wrote:
> From: Ira Weiny <ira.weiny@intel.com>
> 
> Set link state was not supported and so we can return early in the parameter
> checks rather than falling through the switch clause.
> 
> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
> Signed-off-by: Ira Weiny <ira.weiny@intel.com>
> ---
>  drivers/staging/rdma/hfi1/diag.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/rdma/hfi1/diag.c b/drivers/staging/rdma/hfi1/diag.c
> index 556a47591989..a489a79dd3b6 100644
> --- a/drivers/staging/rdma/hfi1/diag.c
> +++ b/drivers/staging/rdma/hfi1/diag.c
> @@ -999,16 +999,14 @@ static long hfi1_ioctl(struct file *fp, unsigned int cmd, unsigned long arg)
>  		 * Other are invalid.
>  		 */
>  		return -EINVAL;
> +	} else if (cmd == HFI1_SNOOP_IOCSETLINKSTATE) {
> +		/* We do not support the old setlink state */
> +		return -EINVAL;

Just delete it and let the default in the switch statement return
-ENOTTY.

regards,
dan carpenter

  reply	other threads:[~2015-11-11  9:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-11  5:43 [PATCH 0/8] Fix hfi1_ioctl locking ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2015-11-11  5:43 ` [PATCH 2/8] staging/rdma/hfi1: Fix camel case variables ira.weiny
2015-11-11  5:43 ` [PATCH 3/8] staging/rdma/hfi1: Return early from hfi1_ioctl parameter errors ira.weiny
2015-11-11  5:43 ` [PATCH 4/8] staging/rdma/hfi1: remove unneeded goto done ira.weiny
     [not found]   ` <1447220589-9067-5-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-11-11  9:01     ` Dan Carpenter
2015-11-11 15:15       ` ira.weiny
2015-11-11  9:03     ` Dan Carpenter
2015-11-11 14:00       ` Dennis Dalessandro
     [not found] ` <1447220589-9067-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-11-11  5:43   ` [PATCH 1/8] staging/rdma/hfi1: diag.c Correct code style issues ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2015-11-11  5:43   ` [PATCH 5/8] staging/rdma/hfi1: return early if setlink state was specified ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2015-11-11  9:06     ` Dan Carpenter [this message]
2015-11-11  5:43   ` [PATCH 6/8] staging/rdma/hfi1: Further clean up hfi1_ioctl parameter checks ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2015-11-11  5:43   ` [PATCH 8/8] staging/rdma/hfi1: Return immediately on error ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2015-11-11  5:43 ` [PATCH 7/8] staging/rdma/hfi1: Reduce snoop locking scope in IOCTL handler ira.weiny

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=20151111090607.GD18797@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=dennis.dalessandro@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=dledford@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ira.weiny@intel.com \
    --cc=linux-rdma@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).