Download Firefox: WindowsMac OS X
logo       
Google Custom Search
    AddThis Social Bookmark Button

[4/15] orinoco merge preliminaries - use ALIGN(): msg#00029

Subject: [4/15] orinoco merge preliminaries - use ALIGN()
Use the kernel's ALIGN macro instead of our own dodgy version for
rounding things up to an even number.

Signed-off-by: David Gibson 
<hermes-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@xxxxxxxxxxxxxxxx>

Index: working-2.6/drivers/net/wireless/orinoco.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco.c     2004-07-28 
15:05:31.213900600 +1000
+++ working-2.6/drivers/net/wireless/orinoco.c  2004-07-28 15:05:34.768360240 
+1000
@@ -490,8 +490,6 @@
 
 #define DUMMY_FID              0xFFFF
 
-#define RUP_EVEN(a) (((a) + 1) & (~1))
-
 /*#define MAX_MULTICAST(priv)  (priv->firmware_type == FIRMWARE_TYPE_AGERE ? \
   HERMES_MAX_MULTICAST : 0)*/
 #define MAX_MULTICAST(priv)    (HERMES_MAX_MULTICAST)
@@ -847,7 +845,7 @@
        }
 
        /* Round up for odd length packets */
-       err = hermes_bap_pwrite(hw, USER_BAP, p, RUP_EVEN(data_len), txfid, 
data_off);
+       err = hermes_bap_pwrite(hw, USER_BAP, p, ALIGN(data_len, 2), txfid, 
data_off);
        if (err) {
                printk(KERN_ERR "%s: Error %d writing packet to BAP\n",
                       dev->name, err);
@@ -1132,7 +1130,7 @@
        }
 
        p = skb_put(skb, data_len);
-       err = hermes_bap_pread(hw, IRQ_BAP, p, RUP_EVEN(data_len),
+       err = hermes_bap_pread(hw, IRQ_BAP, p, ALIGN(data_len, 2),
                               rxfid, data_off);
        if (err) {
                printk(KERN_ERR "%s: error %d reading frame. "


-- 
David Gibson                    | For every complex problem there is a
david AT gibson.dropbear.id.au  | solution which is simple, neat and
                                | wrong.
http://www.ozlabs.org/people/dgibson


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click


<Prev in Thread] Current Thread [Next in Thread>