Re: [PATCH for-next V3 01/11] IB/core: Add gid_type to gid attribute

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




+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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux