From owner-svn-src-head@FreeBSD.ORG Fri Apr 20 21:52:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB693106564A; Fri, 20 Apr 2012 21:52:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD0B08FC0C; Fri, 20 Apr 2012 21:52:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3KLqv7t057173; Fri, 20 Apr 2012 21:52:57 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3KLqvWp057171; Fri, 20 Apr 2012 21:52:57 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201204202152.q3KLqvWp057171@svn.freebsd.org> From: Dimitry Andric Date: Fri, 20 Apr 2012 21:52:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234507 - head/sys/contrib/rdma X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2012 21:52:58 -0000 Author: dim Date: Fri Apr 20 21:52:57 2012 New Revision: 234507 URL: http://svn.freebsd.org/changeset/base/234507 Log: 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 Modified: head/sys/contrib/rdma/rdma_cma.c Modified: head/sys/contrib/rdma/rdma_cma.c ============================================================================== --- head/sys/contrib/rdma/rdma_cma.c Fri Apr 20 21:43:19 2012 (r234506) +++ head/sys/contrib/rdma/rdma_cma.c Fri Apr 20 21:52:57 2012 (r234507) @@ -1252,7 +1252,7 @@ static int cma_iw_handler(struct iw_cm_i *sin = iw_event->local_addr; sin = (struct sockaddr_in *) &id_priv->id.route.addr.dst_addr; *sin = iw_event->remote_addr; - switch (iw_event->status) { + switch ((int)iw_event->status) { case 0: event.event = RDMA_CM_EVENT_ESTABLISHED; break;