freebsd-nq/sys/contrib/rdma
Dimitry Andric a511762672 Fix the following compilation warnings in sys/contrib/rdma/rdma_cma.c:
sys/contrib/rdma/rdma_cma.c:1259:8: error: case value not in enumerated type 'enum iw_cm_event_status' [-Werror,-Wswitch]
	      case ECONNRESET:
		   ^
  @/sys/errno.h:118:20: note: expanded from macro 'ECONNRESET'
  #define ECONNRESET      54              /* Connection reset by peer */
		      ^
  sys/contrib/rdma/rdma_cma.c:1263:8: error: case value not in enumerated type 'enum iw_cm_event_status' [-Werror,-Wswitch]
	      case ETIMEDOUT:
		   ^
  @/sys/errno.h:124:19: note: expanded from macro 'ETIMEDOUT'
  #define ETIMEDOUT       60              /* Operation timed out */
		      ^
  sys/contrib/rdma/rdma_cma.c:1260:8: error: case value not in enumerated type 'enum iw_cm_event_status' [-Werror,-Wswitch]
	      case ECONNREFUSED:
		   ^
  @/sys/errno.h:125:22: note: expanded from macro 'ECONNREFUSED'
  #define ECONNREFUSED    61              /* Connection refused */
		      ^

This is because the switch uses iw_cm_event::status, which is an enum
iw_cm_event_status, while ECONNRESET, ETIMEDOUT and ECONNREFUSED are
just plain defines from errno.h.

It looks like there is only one use of any of the enumeration values of
iw_cm_event_status, in:

  sys/contrib/rdma/rdma_iwcm.c: 	if (iw_event->status == IW_CM_EVENT_STATUS_ACCEPTED) {

So messing around with the enum definitions to fix the warning seems too
disruptive; the simplest fix is to cast the argument of the switch to
int.

Reviewed by:	kmacy
MFC after:	1 week
2012-04-20 21:52:57 +00:00
..
krping Remove the explicit definition of inet_aton() as it was introduced as a 2009-11-12 14:22:12 +00:00
core_priv.h
ib_addr.h In sys/contrib/rdma/ib_addr.h, bump MAX_ADDR_LEN to 20 bytes (the same 2012-01-07 00:47:27 +00:00
ib_cache.h
ib_cm.h
ib_fmr_pool.h
ib_mad.h
ib_marshall.h
ib_pack.h
ib_sa.h
ib_smi.h
ib_umem.h
ib_user_cm.h
ib_user_mad.h
ib_user_sa.h
ib_user_verbs.h
ib_verbs.h
iw_cm.h
rdma_addr.c Modify most routines returning 'struct ifaddr *' to return references 2009-06-23 20:19:09 +00:00
rdma_cache.c
rdma_cm_ib.h
rdma_cm.h
rdma_cma.c Fix the following compilation warnings in sys/contrib/rdma/rdma_cma.c: 2012-04-20 21:52:57 +00:00
rdma_device.c
rdma_iwcm.c
rdma_user_cm.h
rdma_verbs.c
types.h