BNX2X: spatch roundup/rounddown
authorBarret Rhoden <brho@cs.berkeley.edu>
Wed, 11 Feb 2015 16:06:26 +0000 (11:06 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Mon, 2 Mar 2015 16:59:09 +0000 (11:59 -0500)
kern/drivers/net/bnx2x/bnx2x.h
kern/drivers/net/bnx2x/bnx2x_main.c
kern/drivers/net/bnx2x/bnx2x_sriov.h
scripts/spatch/linux/funcs.cocci

index c75fd3d..ee8632b 100644 (file)
@@ -264,8 +264,7 @@ enum {
 /* amount of cids traversed by UIO's DPM addition to doorbell */
 #define UIO_DPM                                8
 /* roundup to DPM offset */
-#define UIO_ROUNDUP(bp)                        (roundup(BNX2X_1st_NON_L2_ETH_CID(bp), \
-                                        UIO_DPM))
+#define UIO_ROUNDUP(bp)                        (ROUNDUP(BNX2X_1st_NON_L2_ETH_CID(bp), UIO_DPM))
 /* offset to nearest value which has lsb nibble matching DPM */
 #define UIO_CID_OFFSET(bp)             ((UIO_ROUNDUP(bp) + UIO_DPM) % \
                                         (UIO_DPM * 2))
index 0af3fd8..716a1b6 100644 (file)
@@ -12993,7 +12993,7 @@ static int bnx2x_set_qm_cid_count(struct bnx2x *bp)
        if (CNIC_SUPPORT(bp))
                cid_count += CNIC_CID_MAX;
 
-       return roundup(cid_count, QM_CID_ROUND);
+       return ROUNDUP(cid_count, QM_CID_ROUND);
 }
 
 /**
index 6b17bbf..a04e4c3 100644 (file)
@@ -245,8 +245,7 @@ void bnx2x_unlock_vf_pf_channel(struct bnx2x *bp, struct bnx2x_virtf *vf,
  */
 
 #define MBX_MSG_ALIGN  8
-#define MBX_MSG_ALIGNED_SIZE   (roundup(sizeof(struct bnx2x_vf_mbx_msg), \
-                               MBX_MSG_ALIGN))
+#define MBX_MSG_ALIGNED_SIZE   (ROUNDUP(sizeof(struct bnx2x_vf_mbx_msg), MBX_MSG_ALIGN))
 
 struct bnx2x_vf_mbx_msg {
        union vfpf_tlvs req;
index 21dcaf4..bc76fd7 100644 (file)
@@ -247,3 +247,18 @@ identifier ARG;
 -irqreturn_t HANDLER(int IRQ, void *ARG
 +void HANDLER(struct hw_trapframe *hw_tf, void *ARG
  );
+
+@@
+expression VAL;
+expression UP;
+@@
+-roundup(VAL, UP)
++ROUNDUP(VAL, UP)
+
+
+@@
+expression VAL;
+expression DOWN;
+@@
+-rounddown(VAL, DOWN)
++ROUNDDOWN(VAL, DOWN)