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 [[email protected]]
Sent: Monday, July 21, 2008 5:33 AM
To: [email protected]; 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 <[email protected]>
---
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);
}
On Mon, Jul 21, 2008 at 3:44 PM, Pavel Roskin <[email protected]> wrote:
> On Mon, 2008-07-21 at 15:39 -0700, Luis R. Rodriguez wrote:
>> > 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) {
>>
>> Its a good thing indeed I split this into two patches, as your first
>> hunk breaks the check. Had you tested this??? Anyway I've fixed this
>> now.
>
> Sorry, I only compile tested it. Indeed, the first comparison should be
> inverted, or we get maximum, not minimum. I didn't want to change the
> code so much, but I wanted to avoid breaking the 80 character limit with
> casts.
We'll need to get you hardware then :)
Luis
> 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) {
Its a good thing indeed I split this into two patches, as your first
hunk breaks the check. Had you tested this??? Anyway I've fixed this
now.
Luis
On Mon, 2008-07-21 at 15:39 -0700, Luis R. Rodriguez wrote:
> > 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) {
>
> Its a good thing indeed I split this into two patches, as your first
> hunk breaks the check. Had you tested this??? Anyway I've fixed this
> now.
Sorry, I only compile tested it. Indeed, the first comparison should be
inverted, or we get maximum, not minimum. I didn't want to change the
code so much, but I wanted to avoid breaking the 80 character limit with
casts.
--
Regards,
Pavel Roskin
Quoting "Luis R. Rodriguez" <[email protected]>:
> We'll need to get you hardware then :)
I have D-Link DWA-645, which has AR5008 chipset. The only problem
with my Cardbus cards is that they are usually not inserted, and I'm
usually on the wrong side of ssh :-)
--
Regards,
Pavel Roskin