]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
IB/ipath: Use unsigned long for irq flags
authorVegard Nossum <vegard.nossum@gmail.com>
Wed, 30 Jul 2008 16:29:06 +0000 (09:29 -0700)
committerRoland Dreier <rolandd@cisco.com>
Wed, 30 Jul 2008 16:29:06 +0000 (09:29 -0700)
A few functions in the ipath driver incorrectly use unsigned int to
hold irq flags for spin_lock_irqsave().

This patch was generated using the Coccinelle framework with the
following semantic patch:

The semantic patch I used was this:

@@
expression lock;
identifier flags;
expression subclass;
@@

- unsigned int flags;
+ unsigned long flags;

...

<+...

(
 spin_lock_irqsave(lock, flags)
|
 _spin_lock_irqsave(lock)
|
 spin_unlock_irqrestore(lock, flags)
|
 _spin_unlock_irqrestore(lock, flags)
|
 read_lock_irqsave(lock, flags)
|
 _read_lock_irqsave(lock)
|
 read_unlock_irqrestore(lock, flags)
|
 _read_unlock_irqrestore(lock, flags)
|
 write_lock_irqsave(lock, flags)
|
 _write_lock_irqsave(lock)
|
 write_unlock_irqrestore(lock, flags)
|
 _write_unlock_irqrestore(lock, flags)
|
 spin_lock_irqsave_nested(lock, flags, subclass)
|
 _spin_lock_irqsave_nested(lock, subclass)
|
 spin_unlock_irqrestore(lock, flags)
|
 _spin_unlock_irqrestore(lock, flags)
|
 _raw_spin_lock_flags(lock, flags)
|
 __raw_spin_lock_flags(lock, flags)
)

...+>

Cc: Ralph Campbell <ralph.campbell@qlogic.com>
Cc: Julia Lawall <julia@diku.dk>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/ipath/ipath_verbs.c

index 55c71882882638508bef3272b97554cc7de334b6..b766e40e9ebf601624e3e33eb072e6a9f9e327b6 100644 (file)
@@ -1021,7 +1021,7 @@ static void sdma_complete(void *cookie, int status)
        struct ipath_verbs_txreq *tx = cookie;
        struct ipath_qp *qp = tx->qp;
        struct ipath_ibdev *dev = to_idev(qp->ibqp.device);
-       unsigned int flags;
+       unsigned long flags;
        enum ib_wc_status ibs = status == IPATH_SDMA_TXREQ_S_OK ?
                IB_WC_SUCCESS : IB_WC_WR_FLUSH_ERR;
 
@@ -1051,7 +1051,7 @@ static void sdma_complete(void *cookie, int status)
 
 static void decrement_dma_busy(struct ipath_qp *qp)
 {
-       unsigned int flags;
+       unsigned long flags;
 
        if (atomic_dec_and_test(&qp->s_dma_busy)) {
                spin_lock_irqsave(&qp->s_lock, flags);
@@ -1221,7 +1221,7 @@ static int ipath_verbs_send_pio(struct ipath_qp *qp,
        unsigned flush_wc;
        u32 control;
        int ret;
-       unsigned int flags;
+       unsigned long flags;
 
        piobuf = ipath_getpiobuf(dd, plen, NULL);
        if (unlikely(piobuf == NULL)) {