[ofa-general] bitops take an unsigned long *

Roland Dreier rdreier at cisco.com
Tue May 13 11:51:58 PDT 2008


OK, I added the below to my tree for my next pull request:

commit f018c7e177a50390f6fcb137f1a28a6027d8ba50
Author: Roland Dreier <rolandd at cisco.com>
Date:   Tue May 13 11:51:23 2008 -0700

    IB/ipath: Change ipath_devdata.ipath_sdma_status to be unsigned long
    
    Andrew Morton <akpm at linux-foundation.org> pointed out that bitops
    should take an unsigned long * arg.  However, the ipath driver was
    doing bitops on struct ipath_devdata.ipath_sdma_status, which is u64.
    Change this member to unsigned long to avoid tons of warnings when x86
    fixes the bitops to take unsigned long * instead of void *.
    
    Also, change the IPATH_SDMA_RUNNING and IPATH_SDMA_SHUTDOWN bit
    numbers to 30 and 31 (instead of 62 and 63) so that we're not setting
    another booby trap for someone who tries to make ipath work on a
    32-bit architecture.
    
    Signed-off-by: Roland Dreier <rolandd at cisco.com>

diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c b/drivers/infiniband/hw/ipath/ipath_driver.c
index 258e66c..daad09a 100644
--- a/drivers/infiniband/hw/ipath/ipath_driver.c
+++ b/drivers/infiniband/hw/ipath/ipath_driver.c
@@ -1894,7 +1894,7 @@ void ipath_cancel_sends(struct ipath_devdata *dd, int restore_sendctrl)
 	 */
 	if (dd->ipath_flags & IPATH_HAS_SEND_DMA) {
 		int skip_cancel;
-		u64 *statp = &dd->ipath_sdma_status;
+		unsigned long *statp = &dd->ipath_sdma_status;
 
 		spin_lock_irqsave(&dd->ipath_sdma_lock, flags);
 		skip_cancel =
diff --git a/drivers/infiniband/hw/ipath/ipath_kernel.h b/drivers/infiniband/hw/ipath/ipath_kernel.h
index 2097587..59a8b25 100644
--- a/drivers/infiniband/hw/ipath/ipath_kernel.h
+++ b/drivers/infiniband/hw/ipath/ipath_kernel.h
@@ -483,7 +483,7 @@ struct ipath_devdata {
 
 	/* SendDMA related entries */
 	spinlock_t            ipath_sdma_lock;
-	u64                   ipath_sdma_status;
+	unsigned long         ipath_sdma_status;
 	unsigned long         ipath_sdma_abort_jiffies;
 	unsigned long         ipath_sdma_abort_intr_timeout;
 	unsigned long         ipath_sdma_buf_jiffies;
@@ -822,8 +822,8 @@ struct ipath_devdata {
 #define IPATH_SDMA_DISARMED  1
 #define IPATH_SDMA_DISABLED  2
 #define IPATH_SDMA_LAYERBUF  3
-#define IPATH_SDMA_RUNNING  62
-#define IPATH_SDMA_SHUTDOWN 63
+#define IPATH_SDMA_RUNNING  30
+#define IPATH_SDMA_SHUTDOWN 31
 
 /* bit combinations that correspond to abort states */
 #define IPATH_SDMA_ABORT_NONE 0



More information about the general mailing list