public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Khapyorsky <sashak@voltaire.com>
To: Sean Hefty <sean.hefty@intel.com>
Cc: ofw@lists.openfabrics.org, linux-rdma <linux-rdma@vger.kernel.org>
Subject: Re: Re: [PATCH] osm_subnet.c
Date: Thu, 12 Nov 2009 21:18:11 +0200	[thread overview]
Message-ID: <20091112191811.GO7192@me> (raw)
In-Reply-To: <A6E929B3F38F455EB28EB478FBAF290E@amr.corp.intel.com>

On 09:20 Mon 05 Oct     , Sean Hefty wrote:
> >>  /**********************************************************************
> >>   **********************************************************************/
> >> -static long compar_mgids(const void *m1, const void *m2)
> >> +static intn_t compar_mgids(const void *m1, const void *m2)
> >
> >Any disagreement about changing a prototype of this method
> >(cl_pfn_fmap_cmp_t) in complib to use standard type (long) instead of
> >"homemade" and less clear one ('intn_t')?
> >
> >Sasha
> >
> >>  {
> >>         return memcmp(m1, m2, sizeof(ib_gid_t));
> >>  }
> 
> If the function is simply a wrapper around a single call to memcmp, why keep it
> at all?

The function is used as comparator callback in complib's fleximap
implementation (just similar to qsort()'s compar parameter and others)
and signed integer (= , >  or < 0) should be returned. Using pointer
sized int as return value is not needed here. We can do it to match
others comparators (qsort, scandir, etc.) prototype exactly:

	int compar(const void *, const void *);

, or to not bother at all and leave it as 'long'.

Hmm, I would prefer to change to 'int' to prevent future confusing.
Thoughts?

Sasha

  reply	other threads:[~2009-11-12 19:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-01 21:35 [PATCH] osm_subnet.c Smith, Stan
2009-10-04  0:13 ` Sasha Khapyorsky
2009-10-05 16:09   ` Smith, Stan
     [not found]     ` <3F6F638B8D880340AB536D29CD4C1E1912C8783C0D-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2009-11-12 19:35       ` Sasha Khapyorsky
2009-10-05 16:20   ` Sean Hefty
2009-11-12 19:18     ` Sasha Khapyorsky [this message]
2009-11-12 19:23       ` [ofw] " Sean Hefty
     [not found]         ` <81D21ED9D6F34BC1B7DA64F50EE5A7DD-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2009-11-12 20:21           ` [PATCH] opensm: cleanup intn_t uses Sasha Khapyorsky
2009-11-12 20:22           ` [PATCH] complib/fleximap: make compar callback to return int Sasha Khapyorsky
2009-11-13 16:06             ` [PATCH] complib: replace intn_t types by C99 intptr_t Sasha Khapyorsky

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=20091112191811.GO7192@me \
    --to=sashak@voltaire.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=ofw@lists.openfabrics.org \
    --cc=sean.hefty@intel.com \
    /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