OSDN Git Service

Remove another set of unecessary typedefs
authorJes Sorensen <Jes.Sorensen@redhat.com>
Tue, 3 Dec 2013 17:27:17 +0000 (18:27 +0100)
committerLarry Finger <Larry.Finger@lwfinger.net>
Tue, 3 Dec 2013 18:24:57 +0000 (12:24 -0600)
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
15 files changed:
core/rtw_br_ext.c
core/rtw_cmd.c
core/rtw_mlme_ext.c
core/rtw_recv.c
core/rtw_security.c
core/rtw_sta_mgt.c
core/rtw_xmit.c
hal/rtl8723au_recv.c
hal/rtl8723au_xmit.c
hal/usb_ops_linux.c
include/basic_types.h
include/rtw_recv.h
include/wifi.h
os_dep/usb_intf.c
os_dep/xmit_linux.c

index d09ad8b..78d0fb1 100644 (file)
@@ -1564,13 +1564,13 @@ void dhcp_flag_bcast(_adapter *priv, struct sk_buff *skb)
 
                        if(iph->protocol == IPPROTO_UDP) /*  UDP */
                        {
-                               struct udphdr *udph = (struct udphdr *)((SIZE_PTR)iph + (iph->ihl << 2));
+                               struct udphdr *udph = (struct udphdr *)((unsigned long)iph + (iph->ihl << 2));
 
                                if((udph->source == __constant_htons(CLIENT_PORT))
                                        && (udph->dest == __constant_htons(SERVER_PORT))) /*  DHCP request */
                                {
                                        struct dhcpMessage *dhcph =
-                                               (struct dhcpMessage *)((SIZE_PTR)udph + sizeof(struct udphdr));
+                                               (struct dhcpMessage *)((unsigned long)udph + sizeof(struct udphdr));
 
                                        if(dhcph->cookie == __constant_htonl(DHCP_MAGIC)) /*  match magic word */
                                        {
index 4a76899..fc85f82 100644 (file)
@@ -60,7 +60,7 @@ _func_enter_;
                goto exit;
        }
 
-       pcmdpriv->cmd_buf = pcmdpriv->cmd_allocated_buf  +  CMDBUFF_ALIGN_SZ - ( (SIZE_PTR)(pcmdpriv->cmd_allocated_buf) & (CMDBUFF_ALIGN_SZ-1));
+       pcmdpriv->cmd_buf = pcmdpriv->cmd_allocated_buf + CMDBUFF_ALIGN_SZ - ((unsigned long)(pcmdpriv->cmd_allocated_buf) & (CMDBUFF_ALIGN_SZ-1));
 
        pcmdpriv->rsp_allocated_buf = rtw_zmalloc(MAX_RSPSZ + 4);
 
@@ -69,7 +69,7 @@ _func_enter_;
                goto exit;
        }
 
-       pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf  +  4 - ( (SIZE_PTR)(pcmdpriv->rsp_allocated_buf) & 3);
+       pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 - ((unsigned long)(pcmdpriv->rsp_allocated_buf) & 3);
 
        pcmdpriv->cmd_issued_cnt = pcmdpriv->cmd_done_cnt = pcmdpriv->rsp_cnt = 0;
 
index 75457ba..a552277 100644 (file)
@@ -1139,8 +1139,8 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame)
        sa = GetAddr2Ptr(pframe);
 
        auth_mode = psecuritypriv->dot11AuthAlgrthm;
-       seq = cpu_to_le16(*(u16*)((SIZE_PTR)pframe + WLAN_HDR_A3_LEN + 2));
-       algorithm = cpu_to_le16(*(u16*)((SIZE_PTR)pframe + WLAN_HDR_A3_LEN));
+       seq = cpu_to_le16(*(u16*)((unsigned long)pframe + WLAN_HDR_A3_LEN + 2));
+       algorithm = cpu_to_le16(*(u16*)((unsigned long)pframe + WLAN_HDR_A3_LEN));
 
        DBG_8723A("auth alg=%x, seq=%X\n", algorithm, seq);
 
@@ -1339,9 +1339,9 @@ unsigned int OnAuthClient(_adapter *padapter, union recv_frame *precv_frame)
 
        offset = (GetPrivacy(pframe))? 4: 0;
 
-       algthm  = le16_to_cpu(*(unsigned short *)((SIZE_PTR)pframe + WLAN_HDR_A3_LEN + offset));
-       seq     = le16_to_cpu(*(unsigned short *)((SIZE_PTR)pframe + WLAN_HDR_A3_LEN + offset + 2));
-       status  = le16_to_cpu(*(unsigned short *)((SIZE_PTR)pframe + WLAN_HDR_A3_LEN + offset + 4));
+       algthm  = le16_to_cpu(*(unsigned short *)((unsigned long)pframe + WLAN_HDR_A3_LEN + offset));
+       seq     = le16_to_cpu(*(unsigned short *)((unsigned long)pframe + WLAN_HDR_A3_LEN + offset + 2));
+       status  = le16_to_cpu(*(unsigned short *)((unsigned long)pframe + WLAN_HDR_A3_LEN + offset + 4));
 
        if (status != 0)
        {
index f1497ac..515726e 100644 (file)
@@ -88,9 +88,7 @@ _func_enter_;
        }
        /* memset(precvpriv->pallocated_frame_buf, 0, NR_RECVFRAME * sizeof(union recv_frame) + RXFRAME_ALIGN_SZ); */
 
-       precvpriv->precv_frame_buf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(precvpriv->pallocated_frame_buf), RXFRAME_ALIGN_SZ);
-       /* precvpriv->precv_frame_buf = precvpriv->pallocated_frame_buf + RXFRAME_ALIGN_SZ - */
-       /*                                              ((SIZE_PTR) (precvpriv->pallocated_frame_buf) &(RXFRAME_ALIGN_SZ-1)); */
+       precvpriv->precv_frame_buf = PTR_ALIGN(precvpriv->pallocated_frame_buf, RXFRAME_ALIGN_SZ);
 
        precvframe = (union recv_frame*) precvpriv->precv_frame_buf;
 
@@ -2158,7 +2156,7 @@ static void recvframe_expand_pkt(
 
        /* 3 2. Prepare new skb to replace & release old skb */
        /*  force ppkt->data at 8-byte alignment address */
-       skb_reserve(ppkt, 8 - ((SIZE_PTR)ppkt->data & 7));
+       skb_reserve(ppkt, 8 - ((unsigned long)ppkt->data & 7));
        /*  force ip_hdr at 8-byte alignment address according to shift_sz */
        skb_reserve(ppkt, shift_sz);
 
index 926178a..e094f6e 100644 (file)
@@ -222,7 +222,7 @@ _func_enter_;
                                arcfour_encrypt(&mycontext, payload+length, crc, 4);
 
                        pframe+=pxmitpriv->frag_len;
-                       pframe=(u8 *)RND4((SIZE_PTR)(pframe));
+                       pframe=(u8 *)RND4((unsigned long)(pframe));
 
                        }
 
@@ -731,7 +731,7 @@ _func_enter_;
                                        arcfour_encrypt(&mycontext, payload+length, crc, 4);
 
                                pframe+=pxmitpriv->frag_len;
-                               pframe=(u8 *)RND4((SIZE_PTR)(pframe));
+                               pframe=(u8 *)RND4((unsigned long)(pframe));
 
                                }
                        }
@@ -1561,7 +1561,7 @@ _func_enter_;
 
                                        aes_cipher(prwskey,pattrib->hdrlen,pframe, length);
                                pframe+=pxmitpriv->frag_len;
-                               pframe=(u8*)RND4((SIZE_PTR)(pframe));
+                               pframe=(u8*)RND4((unsigned long)(pframe));
 
                                }
                        }
index cfdb383..428efef 100644 (file)
@@ -96,7 +96,7 @@ _func_enter_;
                return _FAIL;
 
        pstapriv->pstainfo_buf = pstapriv->pallocated_stainfo_buf + 4 -
-               ((SIZE_PTR)(pstapriv->pallocated_stainfo_buf ) & 3);
+               ((unsigned long)(pstapriv->pallocated_stainfo_buf) & 3);
 
        _rtw_init_queue(&pstapriv->free_sta_queue);
 
index d8b6baf..9b2675b 100644 (file)
@@ -112,9 +112,7 @@ _func_enter_;
                res= _FAIL;
                goto exit;
        }
-       pxmitpriv->pxmit_frame_buf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitpriv->pallocated_frame_buf), 4);
-       /* pxmitpriv->pxmit_frame_buf = pxmitpriv->pallocated_frame_buf + 4 - */
-       /*                                              ((SIZE_PTR) (pxmitpriv->pallocated_frame_buf) &3); */
+       pxmitpriv->pxmit_frame_buf = PTR_ALIGN(pxmitpriv->pallocated_frame_buf, 4);
 
        pxframe = (struct xmit_frame*) pxmitpriv->pxmit_frame_buf;
 
@@ -151,9 +149,7 @@ _func_enter_;
                goto exit;
        }
 
-       pxmitpriv->pxmitbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitpriv->pallocated_xmitbuf), 4);
-       /* pxmitpriv->pxmitbuf = pxmitpriv->pallocated_xmitbuf + 4 - */
-       /*                                              ((SIZE_PTR) (pxmitpriv->pallocated_xmitbuf) &3); */
+       pxmitpriv->pxmitbuf = PTR_ALIGN(pxmitpriv->pallocated_xmitbuf, 4);
 
        pxmitbuf = (struct xmit_buf*)pxmitpriv->pxmitbuf;
 
@@ -205,7 +201,7 @@ _func_enter_;
                res= _FAIL;
                goto exit;
        }
-       pxmitpriv->xframe_ext = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitpriv->xframe_ext_alloc_addr), 4);
+       pxmitpriv->xframe_ext = PTR_ALIGN(pxmitpriv->xframe_ext_alloc_addr, 4);
        pxframe = (struct xmit_frame*)pxmitpriv->xframe_ext;
 
        for (i = 0; i < num_xmit_extbuf; i++) {
@@ -238,7 +234,7 @@ _func_enter_;
                goto exit;
        }
 
-       pxmitpriv->pxmit_extbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitpriv->pallocated_xmit_extbuf), 4);
+       pxmitpriv->pxmit_extbuf = PTR_ALIGN(pxmitpriv->pallocated_xmit_extbuf, 4);
 
        pxmitbuf = (struct xmit_buf*)pxmitpriv->pxmit_extbuf;
 
@@ -258,7 +254,7 @@ _func_enter_;
                        goto exit;
                }
 
-               pxmitbuf->pbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitbuf->pallocated_buf), 4);
+               pxmitbuf->pbuf = PTR_ALIGN(pxmitbuf->pallocated_buf, 4);
 */
 
                if((res=rtw_os_xmit_resource_alloc(padapter, pxmitbuf,max_xmit_extbuf_size + XMITBUF_ALIGN_SZ)) == _FAIL) {
@@ -964,7 +960,7 @@ _func_enter_;
                        payload=pframe;
 
                        for(curfragnum=0;curfragnum<pattrib->nr_frags;curfragnum++){
-                               payload=(u8 *)RND4((SIZE_PTR)(payload));
+                               payload=(u8 *)RND4((unsigned long)(payload));
                                RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("===curfragnum=%d, pframe= 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x,!!!\n",
                                        curfragnum,*payload, *(payload+1),*(payload+2),*(payload+3),*(payload+4),*(payload+5),*(payload+6),*(payload+7)));
 
@@ -1634,7 +1630,7 @@ s32 rtw_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame *pxm
 
        s32 frg_inx, frg_len, mpdu_len, llc_sz, mem_sz;
 
-       SIZE_PTR addr;
+       unsigned long addr;
 
        u8 *pframe, *mem_start;
        u8 hw_hdr_offset;
@@ -1807,7 +1803,7 @@ _func_enter_;
                        RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("%s: There're still something in packet!\n", __FUNCTION__));
                }
 
-               addr = (SIZE_PTR)(pframe);
+               addr = (unsigned long)pframe;
 
                mem_start = (unsigned char *)RND4(addr) + hw_hdr_offset;
                memcpy(mem_start, pbuf_start + hw_hdr_offset, pattrib->hdrlen);
@@ -2273,7 +2269,7 @@ struct xmit_frame *rtw_alloc_xmitframe_once(struct xmit_priv *pxmitpriv)
        if (alloc_addr == NULL)
                goto exit;
 
-       pxframe = (struct xmit_frame *)N_BYTE_ALIGMENT((SIZE_PTR)(alloc_addr), 4);
+       pxframe = (struct xmit_frame *)PTR_ALIGN(alloc_addr, 4);
        pxframe->alloc_addr = alloc_addr;
 
        pxframe->padapter = pxmitpriv->adapter;
index 182d94a..0a6cd03 100644 (file)
@@ -93,10 +93,7 @@ int  rtl8192cu_init_recv_priv(_adapter *padapter)
                goto exit;
        }
 
-       precvpriv->precv_buf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(precvpriv->pallocated_recv_buf), 4);
-       //precvpriv->precv_buf = precvpriv->pallocated_recv_buf + 4 -
-       //                                              ((uint) (precvpriv->pallocated_recv_buf) &(4-1));
-
+       precvpriv->precv_buf = PTR_ALIGN(precvpriv->pallocated_recv_buf, 4);
 
        precvbuf = (struct recv_buf*)precvpriv->precv_buf;
 
@@ -129,9 +126,9 @@ int rtl8192cu_init_recv_priv(_adapter *padapter)
 #ifdef CONFIG_PREALLOC_RECV_SKB
        {
                int i;
-               SIZE_PTR tmpaddr=0;
-               SIZE_PTR alignment=0;
-               struct sk_buff *pskb=NULL;
+               unsigned long tmpaddr = 0;
+               unsigned long alignment = 0;
+               struct sk_buff *pskb = NULL;
 
                skb_queue_head_init(&precvpriv->free_recv_skb_queue);
 
@@ -148,7 +145,7 @@ int rtl8192cu_init_recv_priv(_adapter *padapter)
                        {
                                pskb->dev = padapter->pnetdev;
 
-                               tmpaddr = (SIZE_PTR)pskb->data;
+                               tmpaddr = (unsigned long)pskb->data;
                                alignment = tmpaddr & (RECVBUFF_ALIGN_SZ-1);
                                skb_reserve(pskb, (RECVBUFF_ALIGN_SZ - alignment));
 
index f9fa4b7..c052346 100644 (file)
@@ -548,7 +548,7 @@ static s32 rtw_dump_xframe(_adapter *padapter, struct xmit_frame *pxmitframe)
 
                mem_addr += w_sz;
 
-               mem_addr = (u8 *)RND4(((SIZE_PTR)(mem_addr)));
+               mem_addr = (u8 *)RND4(((unsigned long)(mem_addr)));
 
        }
 
index cd5bf93..4aa9896 100644 (file)
@@ -92,7 +92,7 @@ static int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u
        // Added by Albert 2010/02/09
        // For mstar platform, mstar suggests the address for USB IO should be 16 bytes alignment.
        // Trying to fix it here.
-       pIo_buf = (tmp_buf==NULL)?NULL:tmp_buf + ALIGNMENT_UNIT -((SIZE_PTR)(tmp_buf) & 0x0f );
+       pIo_buf = (tmp_buf==NULL)?NULL:tmp_buf + ALIGNMENT_UNIT -((unsigned long)(tmp_buf) & 0x0f );
 #endif
 
        if ( pIo_buf== NULL) {
@@ -760,7 +760,7 @@ static int recvbuf2recvframe(_adapter *padapter, struct recv_buf *precvbuf)
                        precvframe->u.hdr.pkt = pkt_copy;
                        precvframe->u.hdr.rx_head = pkt_copy->data;
                        precvframe->u.hdr.rx_end = pkt_copy->data + alloc_sz;
-                       skb_reserve( pkt_copy, 8 - ((SIZE_PTR)( pkt_copy->data ) & 7 ));//force pkt_copy->data at 8-byte alignment address
+                       skb_reserve(pkt_copy, 8 - ((unsigned long)(pkt_copy->data) & 7));//force pkt_copy->data at 8-byte alignment address
                        skb_reserve( pkt_copy, shift_sz );//force ip_hdr at 8-byte alignment address according to shift_sz.
                        memcpy(pkt_copy->data, (pbuf + pattrib->shift_sz + pattrib->drvinfo_sz + RXDESC_SIZE), skb_len);
                        precvframe->u.hdr.rx_data = precvframe->u.hdr.rx_tail = pkt_copy->data;
@@ -1164,7 +1164,7 @@ static s32 pre_recv_entry(union recv_frame *precvframe, struct recv_stat *prxsta
                                        precvframe_if2->u.hdr.pkt = pkt_copy;
                                        precvframe_if2->u.hdr.rx_head = pkt_copy->data;
                                        precvframe_if2->u.hdr.rx_end = pkt_copy->data + alloc_sz;
-                                       skb_reserve( pkt_copy, 8 - ((SIZE_PTR)( pkt_copy->data ) & 7 ));//force pkt_copy->data at 8-byte alignment address
+                                       skb_reserve( pkt_copy, 8 - ((unsigned long)(pkt_copy->data) & 7));//force pkt_copy->data at 8-byte alignment address
                                        skb_reserve( pkt_copy, shift_sz );//force ip_hdr at 8-byte alignment address according to shift_sz.
                                        memcpy(pkt_copy->data, pbuf, skb_len);
                                        precvframe_if2->u.hdr.rx_data = precvframe_if2->u.hdr.rx_tail = pkt_copy->data;
@@ -1307,7 +1307,7 @@ static int recvbuf2recvframe(_adapter *padapter, _pkt *pskb)
                        precvframe->u.hdr.pkt = pkt_copy;
                        precvframe->u.hdr.rx_head = pkt_copy->data;
                        precvframe->u.hdr.rx_end = pkt_copy->data + alloc_sz;
-                       skb_reserve( pkt_copy, 8 - ((SIZE_PTR)( pkt_copy->data ) & 7 ));//force pkt_copy->data at 8-byte alignment address
+                       skb_reserve( pkt_copy, 8 - ((unsigned long)( pkt_copy->data ) & 7 ));//force pkt_copy->data at 8-byte alignment address
                        skb_reserve( pkt_copy, shift_sz );//force ip_hdr at 8-byte alignment address according to shift_sz.
                        memcpy(pkt_copy->data, (pbuf + pattrib->shift_sz + pattrib->drvinfo_sz + RXDESC_SIZE), skb_len);
                        precvframe->u.hdr.rx_data = precvframe->u.hdr.rx_tail = pkt_copy->data;
@@ -1543,8 +1543,8 @@ static u32 usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem)
        _irqL irqL;
        int err;
        unsigned int pipe;
-       SIZE_PTR tmpaddr=0;
-       SIZE_PTR alignment=0;
+       unsigned long tmpaddr = 0;
+       unsigned long alignment = 0;
        u32 ret = _SUCCESS;
        PURB purb = NULL;
        struct recv_buf *precvbuf = (struct recv_buf *)rmem;
@@ -1590,7 +1590,7 @@ _func_enter_;
                        return _FAIL;
                }
 
-               tmpaddr = (SIZE_PTR)precvbuf->pskb->data;
+               tmpaddr = (unsigned long)precvbuf->pskb->data;
                alignment = tmpaddr & (RECVBUFF_ALIGN_SZ-1);
                skb_reserve(precvbuf->pskb, (RECVBUFF_ALIGN_SZ - alignment));
 
index b50956f..d7b6104 100644 (file)
@@ -54,9 +54,6 @@ typedef       __kernel_ssize_t        SSIZE_T;
 #define MEM_ALIGNMENT_OFFSET   (sizeof (SIZE_T))
 #define MEM_ALIGNMENT_PADDING  (sizeof(SIZE_T) - 1)
 
-#define SIZE_PTR SIZE_T
-#define SSIZE_PTR SSIZE_T
-
 //port from fw by thomas
 // TODO: Belows are Sync from SD7-Driver. It is necessary to check correctness
 
index 8a2b8da..a254cca 100644 (file)
@@ -628,7 +628,7 @@ __inline static union recv_frame *rxmem_to_recvframe(u8 *rxmem)
        //from any given member of recv_frame.
        // rxmem indicates the any member/address in recv_frame
 
-       return (union recv_frame*)(((SIZE_PTR)rxmem >> RXFRAME_ALIGN) << RXFRAME_ALIGN);
+       return (union recv_frame*)(((unsigned long)rxmem >> RXFRAME_ALIGN) << RXFRAME_ALIGN);
 
 }
 
index b4679d9..30eca78 100644 (file)
@@ -356,29 +356,29 @@ enum WIFI_REG_DOMAIN {
                *(unsigned short *)(pbuf) |= cpu_to_le16(type); \
        } while(0)
 
-#define GetSequence(pbuf)      (cpu_to_le16(*(unsigned short *)((SIZE_PTR)(pbuf) + 22)) >> 4)
+#define GetSequence(pbuf)      (cpu_to_le16(*(unsigned short *)((unsigned long)(pbuf) + 22)) >> 4)
 
-#define GetFragNum(pbuf)       (cpu_to_le16(*(unsigned short *)((SIZE_PTR)(pbuf) + 22)) & 0x0f)
+#define GetFragNum(pbuf)       (cpu_to_le16(*(unsigned short *)((unsigned long)(pbuf) + 22)) & 0x0f)
 
-#define GetTupleCache(pbuf)    (cpu_to_le16(*(unsigned short *)((SIZE_PTR)(pbuf) + 22)))
+#define GetTupleCache(pbuf)    (cpu_to_le16(*(unsigned short *)((unsigned long)(pbuf) + 22)))
 
 #define SetFragNum(pbuf, num) \
        do {    \
-               *(unsigned short *)((SIZE_PTR)(pbuf) + 22) = \
-                       ((*(unsigned short *)((SIZE_PTR)(pbuf) + 22)) & le16_to_cpu(~(0x000f))) | \
+               *(unsigned short *)((unsigned long)(pbuf) + 22) = \
+                       ((*(unsigned short *)((unsigned long)(pbuf) + 22)) & le16_to_cpu(~(0x000f))) | \
                        cpu_to_le16(0x0f & (num));     \
        } while(0)
 
 #define SetSeqNum(pbuf, num) \
        do {    \
-               *(unsigned short *)((SIZE_PTR)(pbuf) + 22) = \
-                       ((*(unsigned short *)((SIZE_PTR)(pbuf) + 22)) & le16_to_cpu((unsigned short)0x000f)) | \
+               *(unsigned short *)((unsigned long)(pbuf) + 22) = \
+                       ((*(unsigned short *)((unsigned long)(pbuf) + 22)) & le16_to_cpu((unsigned short)0x000f)) | \
                        le16_to_cpu((unsigned short)(0xfff0 & (num << 4))); \
        } while(0)
 
 #define SetDuration(pbuf, dur) \
        do {    \
-               *(unsigned short *)((SIZE_PTR)(pbuf) + 2) = cpu_to_le16(0xffff & (dur)); \
+               *(unsigned short *)((unsigned long)(pbuf) + 2) = cpu_to_le16(0xffff & (dur)); \
        } while(0)
 
 
@@ -408,17 +408,17 @@ enum WIFI_REG_DOMAIN {
                *(unsigned short *)(pbuf) |= cpu_to_le16( (amsdu & 1) << 7); \
        } while(0)
 
-#define GetAid(pbuf)   (cpu_to_le16(*(unsigned short *)((SIZE_PTR)(pbuf) + 2)) & 0x3fff)
+#define GetAid(pbuf)   (cpu_to_le16(*(unsigned short *)((unsigned long)(pbuf) + 2)) & 0x3fff)
 
-#define GetTid(pbuf)   (cpu_to_le16(*(unsigned short *)((SIZE_PTR)(pbuf) + (((GetToDs(pbuf)<<1)|GetFrDs(pbuf))==3?30:24))) & 0x000f)
+#define GetTid(pbuf)   (cpu_to_le16(*(unsigned short *)((unsigned long)(pbuf) + (((GetToDs(pbuf)<<1)|GetFrDs(pbuf))==3?30:24))) & 0x000f)
 
-#define GetAddr1Ptr(pbuf)      ((unsigned char *)((SIZE_PTR)(pbuf) + 4))
+#define GetAddr1Ptr(pbuf)      ((unsigned char *)((unsigned long)(pbuf) + 4))
 
-#define GetAddr2Ptr(pbuf)      ((unsigned char *)((SIZE_PTR)(pbuf) + 10))
+#define GetAddr2Ptr(pbuf)      ((unsigned char *)((unsigned long)(pbuf) + 10))
 
-#define GetAddr3Ptr(pbuf)      ((unsigned char *)((SIZE_PTR)(pbuf) + 16))
+#define GetAddr3Ptr(pbuf)      ((unsigned char *)((unsigned long)(pbuf) + 16))
 
-#define GetAddr4Ptr(pbuf)      ((unsigned char *)((SIZE_PTR)(pbuf) + 24))
+#define GetAddr4Ptr(pbuf)      ((unsigned char *)((unsigned long)(pbuf) + 24))
 
 #define MacAddr_isBcst(addr) \
 ( \
index 6aa7a2b..74abb3c 100644 (file)
@@ -293,8 +293,8 @@ static u8 rtw_init_intf_priv(struct dvobj_priv *dvobj)
                rst = _FAIL;
                goto exit;
        }
-       dvobj->usb_vendor_req_buf  =
-               (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(dvobj->usb_alloc_vendor_req_buf ), ALIGNMENT_UNIT);
+       dvobj->usb_vendor_req_buf =
+               PTR_ALIGN(dvobj->usb_alloc_vendor_req_buf, ALIGNMENT_UNIT);
 exit:
 #endif
 
index 5b3c8be..44bf03f 100644 (file)
@@ -33,7 +33,7 @@
 
 uint rtw_remainder_len(struct pkt_file *pfile)
 {
-       return (pfile->buf_len - ((SIZE_PTR)(pfile->cur_addr) - (SIZE_PTR)(pfile->buf_start)));
+       return (pfile->buf_len - ((unsigned long)(pfile->cur_addr) - (unsigned long)(pfile->buf_start)));
 }
 
 void _rtw_open_pktfile (_pkt *pktptr, struct pkt_file *pfile)
@@ -141,7 +141,7 @@ int rtw_os_xmit_resource_alloc(_adapter *padapter, struct xmit_buf *pxmitbuf,u32
                return _FAIL;
        }
 
-       pxmitbuf->pbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitbuf->pallocated_buf), XMITBUF_ALIGN_SZ);
+       pxmitbuf->pbuf = PTR_ALIGN(pxmitbuf->pallocated_buf, XMITBUF_ALIGN_SZ);
        pxmitbuf->dma_transfer_addr = 0;
 
 #endif // CONFIG_USE_USB_BUFFER_ALLOC_TX
@@ -163,7 +163,7 @@ int rtw_os_xmit_resource_alloc(_adapter *padapter, struct xmit_buf *pxmitbuf,u32
                return _FAIL;
        }
 
-       pxmitbuf->pbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitbuf->pallocated_buf), XMITBUF_ALIGN_SZ);
+       pxmitbuf->pbuf = PTR_ALIGN(pxmitbuf->pallocated_buf, XMITBUF_ALIGN_SZ);
 #endif
 
        return _SUCCESS;