public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: Jason Gunthorpe <jgg-uk2M96/98Pc@public.gmane.org>
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] librdmacm: Set errno correctly if status is positive
Date: Wed, 10 Jan 2018 20:33:18 +0200	[thread overview]
Message-ID: <20180110183318.GA14534@yuvallap> (raw)
In-Reply-To: <20180110182932.GJ4518-uk2M96/98Pc@public.gmane.org>

On Wed, Jan 10, 2018 at 11:29:32AM -0700, Jason Gunthorpe wrote:
> On Wed, Jan 10, 2018 at 06:07:21PM +0200, Yuval Shaia wrote:
> > No need to convert to positive if status is already positive.
> > 
> > Fixes: 1ef5c3a84 ("librdmacm: Set errno correctly in ucma_complete")
> > 
> > Signed-off-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> >  librdmacm/cma.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/librdmacm/cma.c b/librdmacm/cma.c
> > index 25ebaaee..fb2dc5e4 100644
> > +++ b/librdmacm/cma.c
> > @@ -866,7 +866,7 @@ int ucma_complete(struct rdma_cm_id *id)
> >  		else if (id_priv->id.event->status < 0)
> >  			ret = ERR(-id_priv->id.event->status);
> >  		else
> > -			ret = ERR(-id_priv->id.event->status);
> > +			ret = ERR(id_priv->id.event->status);
> 
> This code hurts my brain - why is status sometimes a possitive errno
> and sometimes a negative errno?

Have no idea :)
But since current code ask "if (id_priv->id.event->status < 0)" i assume it
can.

> 
> Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2018-01-10 18:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-10 16:07 [PATCH] librdmacm: Set errno correctly if status is positive Yuval Shaia
     [not found] ` <20180110160721.14469-1-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2018-01-10 18:29   ` Jason Gunthorpe
     [not found]     ` <20180110182932.GJ4518-uk2M96/98Pc@public.gmane.org>
2018-01-10 18:33       ` Yuval Shaia [this message]
2018-01-23 17:02         ` Doug Ledford

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=20180110183318.GA14534@yuvallap \
    --to=yuval.shaia-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
    --cc=jgg-uk2M96/98Pc@public.gmane.org \
    --cc=leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.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