From owner-svn-src-head@FreeBSD.ORG Mon Nov 12 22:01:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 676024E1; Mon, 12 Nov 2012 22:01:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 428F68FC0C; Mon, 12 Nov 2012 22:01:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qACM1USo015465; Mon, 12 Nov 2012 22:01:30 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qACM1T1u015459; Mon, 12 Nov 2012 22:01:29 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211122201.qACM1T1u015459@svn.freebsd.org> From: Dimitry Andric Date: Mon, 12 Nov 2012 22:01:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242933 - in head/sys: conf modules/mthca ofed/drivers/infiniband/core ofed/drivers/infiniband/ulp/sdp ofed/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 12 Nov 2012 22:01:30 -0000 Author: dim Date: Mon Nov 12 22:01:29 2012 New Revision: 242933 URL: http://svnweb.freebsd.org/changeset/base/242933 Log: Redo r242842, now actually fixing the warnings, as follows: - In sys/ofed/drivers/infiniband/core/cma.c, an enum struct member is interpreted as an int, so cast it to an int. - In sys/ofed/drivers/infiniband/core/ud_header.c, initialize the packet_length variable in ib_ud_header_init(), to prevent undefined behaviour. - In sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c, call rdma_notify() with the correct enum type and value. - In sys/ofed/include/linux/pci.h, change the PCI_DEVICE and PCI_VDEVICE macros to use C99 struct initializers, so additional members can be overridden. Reviewed by: delphij, Garrett Cooper MFC after: 1 week Modified: head/sys/conf/kern.pre.mk head/sys/modules/mthca/Makefile head/sys/ofed/drivers/infiniband/core/cma.c head/sys/ofed/drivers/infiniband/core/ud_header.c head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c head/sys/ofed/include/linux/pci.h Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Mon Nov 12 20:50:15 2012 (r242932) +++ head/sys/conf/kern.pre.mk Mon Nov 12 22:01:29 2012 (r242933) @@ -156,7 +156,7 @@ NORMAL_LINT= ${LINT} ${LINTFLAGS} ${CFLA # Infiniband C flags. Correct include paths and omit errors that linux # does not honor. OFEDINCLUDES= -I$S/ofed/include/ -OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith -fms-extensions -Wno-switch -Wno-sometimes-uninitialized -Wno-conversion -Wno-initializer-overrides +OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith -fms-extensions OFEDCFLAGS= ${CFLAGS:N-I*} ${OFEDINCLUDES} ${CFLAGS:M-I*} ${OFEDNOERR} OFED_C_NOIMP= ${CC} -c -o ${.TARGET} ${OFEDCFLAGS} ${WERROR} ${PROF} OFED_C= ${OFED_C_NOIMP} ${.IMPSRC} Modified: head/sys/modules/mthca/Makefile ============================================================================== --- head/sys/modules/mthca/Makefile Mon Nov 12 20:50:15 2012 (r242932) +++ head/sys/modules/mthca/Makefile Mon Nov 12 22:01:29 2012 (r242933) @@ -28,4 +28,4 @@ opt_inet6.h: .include -CFLAGS+= -Wno-cast-qual -Wno-pointer-arith -fms-extensions -Wno-switch -Wno-sometimes-uninitialized -Wno-conversion -Wno-initializer-overrides +CFLAGS+= -Wno-cast-qual -Wno-pointer-arith -fms-extensions Modified: head/sys/ofed/drivers/infiniband/core/cma.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/cma.c Mon Nov 12 20:50:15 2012 (r242932) +++ head/sys/ofed/drivers/infiniband/core/cma.c Mon Nov 12 22:01:29 2012 (r242933) @@ -1312,7 +1312,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; Modified: head/sys/ofed/drivers/infiniband/core/ud_header.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ud_header.c Mon Nov 12 20:50:15 2012 (r242932) +++ head/sys/ofed/drivers/infiniband/core/ud_header.c Mon Nov 12 22:01:29 2012 (r242933) @@ -230,7 +230,7 @@ void ib_ud_header_init(int pay int immediate_present, struct ib_ud_header *header) { - u16 packet_length; + u16 packet_length = 0; memset(header, 0, sizeof *header); Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Mon Nov 12 20:50:15 2012 (r242932) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Mon Nov 12 22:01:29 2012 (r242933) @@ -590,7 +590,7 @@ sdp_rx_comp_work(struct work_struct *wor if (unlikely(!ssk->poll_cq)) { struct rdma_cm_id *id = ssk->id; if (id && id->qp) - rdma_notify(id, RDMA_CM_EVENT_ESTABLISHED); + rdma_notify(id, IB_EVENT_COMM_EST); goto out; } Modified: head/sys/ofed/include/linux/pci.h ============================================================================== --- head/sys/ofed/include/linux/pci.h Mon Nov 12 20:50:15 2012 (r242932) +++ head/sys/ofed/include/linux/pci.h Mon Nov 12 22:01:29 2012 (r242933) @@ -73,10 +73,12 @@ struct pci_device_id { #define PCI_DEVICE_ID_MELLANOX_SINAI 0x6274 -#define PCI_VDEVICE(vendor, device) \ - PCI_VENDOR_ID_##vendor, (device), PCI_ANY_ID, PCI_ANY_ID, 0, 0 -#define PCI_DEVICE(vendor, device) \ - (vendor), (device), PCI_ANY_ID, PCI_ANY_ID, 0, 0 +#define PCI_VDEVICE(_vendor, _device) \ + .vendor = PCI_VENDOR_ID_##_vendor, .device = (_device), \ + .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID +#define PCI_DEVICE(_vendor, _device) \ + .vendor = (_vendor), .device = (_device), \ + .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID #define to_pci_dev(n) container_of(n, struct pci_dev, dev)