Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Nov 2012 18:27:03 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r243375 - in stable/9/sys/ofed: drivers/infiniband/core drivers/infiniband/ulp/sdp include/linux
Message-ID:  <201211211827.qALIR3eu008509@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Wed Nov 21 18:27:02 2012
New Revision: 243375
URL: http://svnweb.freebsd.org/changeset/base/243375

Log:
  MFC r242933:
  
  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 <yanegomi@gmail.com>

Modified:
  stable/9/sys/ofed/drivers/infiniband/core/cma.c
  stable/9/sys/ofed/drivers/infiniband/core/ud_header.c
  stable/9/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c
  stable/9/sys/ofed/include/linux/pci.h
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/ofed/drivers/infiniband/core/cma.c
==============================================================================
--- stable/9/sys/ofed/drivers/infiniband/core/cma.c	Wed Nov 21 18:12:28 2012	(r243374)
+++ stable/9/sys/ofed/drivers/infiniband/core/cma.c	Wed Nov 21 18:27:02 2012	(r243375)
@@ -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: stable/9/sys/ofed/drivers/infiniband/core/ud_header.c
==============================================================================
--- stable/9/sys/ofed/drivers/infiniband/core/ud_header.c	Wed Nov 21 18:12:28 2012	(r243374)
+++ stable/9/sys/ofed/drivers/infiniband/core/ud_header.c	Wed Nov 21 18:27:02 2012	(r243375)
@@ -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: stable/9/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c
==============================================================================
--- stable/9/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c	Wed Nov 21 18:12:28 2012	(r243374)
+++ stable/9/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c	Wed Nov 21 18:27:02 2012	(r243375)
@@ -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: stable/9/sys/ofed/include/linux/pci.h
==============================================================================
--- stable/9/sys/ofed/include/linux/pci.h	Wed Nov 21 18:12:28 2012	(r243374)
+++ stable/9/sys/ofed/include/linux/pci.h	Wed Nov 21 18:27:02 2012	(r243375)
@@ -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)
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211211827.qALIR3eu008509>