Search Linux Wireless

RE: [PATCH] ath9k: fix build errors and warnings on 64-bit systems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks, I split this into two patches. I've updated the patch series for wireless-testing as well:

http://www.kernel.org/pub/linux/kernel/people/mcgrof/patches/ath9k/

  Luis
________________________________________
From: Pavel Roskin [proski@xxxxxxx]
Sent: Monday, July 21, 2008 5:33 AM
To: ath9k-devel@xxxxxxxxxxxxxxx; Luis Rodriguez
Subject: [PATCH] ath9k: fix build errors and warnings on 64-bit systems

Use skb_end_pointer(skb), not skb->end.  The later is not portable.
Avoid comparison of incompatible types.

Signed-off-by: Pavel Roskin <proski@xxxxxxx>
---

 ksrc/hw.c   |    6 ++++--
 ksrc/recv.c |    5 +++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/ksrc/hw.c b/ksrc/hw.c
index b8a9321..5a24cbe 100644
--- a/ksrc/hw.c
+++ b/ksrc/hw.c
@@ -852,9 +852,11 @@ static inline enum hal_status ath9k_hw_check_eeprom(struct ath_hal *ah)
        else
                el = ahp->ah_eeprom.baseEepHeader.length;

+       if (el < sizeof(struct ar5416_eeprom) / sizeof(u_int16_t))
+               el = sizeof(struct ar5416_eeprom) / sizeof(u_int16_t);
+
        eepdata = (u_int16_t *) (&ahp->ah_eeprom);
-       for (i = 0; i <
-               min(el, sizeof(struct ar5416_eeprom)) / sizeof(u_int16_t); i++)
+       for (i = 0; i < el; i++)
                sum ^= *eepdata++;

        if (need_swap) {
diff --git a/ksrc/recv.c b/ksrc/recv.c
index a48c9e9..e111e9d 100644
--- a/ksrc/recv.c
+++ b/ksrc/recv.c
@@ -1380,7 +1380,7 @@ dma_addr_t ath_skb_map_single(struct ath_softc *sc,
         * Use skb's entire data area instead.
         */
        *pa = pci_map_single(sc->pdev, skb->data,
-               skb->end - skb->head, direction);
+               skb_end_pointer(skb) - skb->head, direction);
        return *pa;
 }

@@ -1390,5 +1390,6 @@ void ath_skb_unmap_single(struct ath_softc *sc,
                          dma_addr_t *pa)
 {
        /* Unmap skb's entire data area */
-       pci_unmap_single(sc->pdev, *pa, skb->end - skb->head, direction);
+       pci_unmap_single(sc->pdev, *pa,
+                        skb_end_pointer(skb) - skb->head, direction);
 }
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux