From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sagi Grimberg Subject: Re: [PATCH for-next V3 01/11] IB/core: Add gid_type to gid attribute Date: Wed, 23 Dec 2015 17:38:49 +0200 Message-ID: <567AC009.2030106@dev.mellanox.co.il> References: <1450875417-19262-1-git-send-email-matanb@mellanox.com> <1450875417-19262-2-git-send-email-matanb@mellanox.com> <20151223134053.GB3599@leon.nu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Matan Barak , leon-2ukJVAZIZ/Y@public.gmane.org, Matan Barak , Doug Ledford , linux-rdma , Eran Ben Elisha , Haggai Eran , Or Gerlitz , Jason Gunthorpe , Somnath Kotur , Majd Dibbiny List-Id: linux-rdma@vger.kernel.org >>> +static const char * const gid_type_str[] = { >> ^^ ^^ >> IMHO, The white spaces can be a little bit confusing to understand. >> > > Pay attention to the double const - I think it's more clear that way. I agree. > >>> + [IB_GID_TYPE_IB] = "IB/RoCE v1", >>> +}; >>> + >>> +const char *ib_cache_gid_type_str(enum ib_gid_type gid_type) >>> +{ >>> + if (gid_type < ARRAY_SIZE(gid_type_str) && gid_type_str[gid_type]) >> Why do you need to check second condition? > > If we want to leave a gap for an invalid GID type, we could do that. > Anyway, we could remove this as an incremental future patch if that's > really important. Leave it in, better safe than sorry... -- 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