* RE: [PATCH] ath9k: fix build errors and warnings on 64-bit systems [not found] <20080721000313.24845.10866.stgit@dv.roinet.com> @ 2008-07-21 13:53 ` Luis Rodriguez 2008-07-21 22:39 ` Luis R. Rodriguez 0 siblings, 1 reply; 5+ messages in thread From: Luis Rodriguez @ 2008-07-21 13:53 UTC (permalink / raw) To: Pavel Roskin, ath9k-devel@lists.ath9k.org; +Cc: linux-wireless@vger.kernel.org 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@gnu.org] Sent: Monday, July 21, 2008 5:33 AM To: ath9k-devel@lists.ath9k.org; 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@gnu.org> --- 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); } ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] ath9k: fix build errors and warnings on 64-bit systems 2008-07-21 13:53 ` [PATCH] ath9k: fix build errors and warnings on 64-bit systems Luis Rodriguez @ 2008-07-21 22:39 ` Luis R. Rodriguez 2008-07-21 22:44 ` Pavel Roskin 0 siblings, 1 reply; 5+ messages in thread From: Luis R. Rodriguez @ 2008-07-21 22:39 UTC (permalink / raw) To: Luis Rodriguez Cc: Pavel Roskin, ath9k-devel@lists.ath9k.org, linux-wireless@vger.kernel.org > 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 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ath9k: fix build errors and warnings on 64-bit systems 2008-07-21 22:39 ` Luis R. Rodriguez @ 2008-07-21 22:44 ` Pavel Roskin 2008-07-21 22:52 ` Luis R. Rodriguez 0 siblings, 1 reply; 5+ messages in thread From: Pavel Roskin @ 2008-07-21 22:44 UTC (permalink / raw) To: Luis R. Rodriguez Cc: ath9k-devel@lists.ath9k.org, linux-wireless@vger.kernel.org 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 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ath9k: fix build errors and warnings on 64-bit systems 2008-07-21 22:44 ` Pavel Roskin @ 2008-07-21 22:52 ` Luis R. Rodriguez 2008-07-21 23:55 ` Pavel Roskin 0 siblings, 1 reply; 5+ messages in thread From: Luis R. Rodriguez @ 2008-07-21 22:52 UTC (permalink / raw) To: Pavel Roskin; +Cc: ath9k-devel@lists.ath9k.org, linux-wireless@vger.kernel.org On Mon, Jul 21, 2008 at 3:44 PM, Pavel Roskin <proski@gnu.org> 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 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ath9k: fix build errors and warnings on 64-bit systems 2008-07-21 22:52 ` Luis R. Rodriguez @ 2008-07-21 23:55 ` Pavel Roskin 0 siblings, 0 replies; 5+ messages in thread From: Pavel Roskin @ 2008-07-21 23:55 UTC (permalink / raw) To: Luis R. Rodriguez Cc: ath9k-devel@lists.ath9k.org, linux-wireless@vger.kernel.org Quoting "Luis R. Rodriguez" <mcgrof@gmail.com>: > 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 ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-07-21 23:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20080721000313.24845.10866.stgit@dv.roinet.com>
2008-07-21 13:53 ` [PATCH] ath9k: fix build errors and warnings on 64-bit systems Luis Rodriguez
2008-07-21 22:39 ` Luis R. Rodriguez
2008-07-21 22:44 ` Pavel Roskin
2008-07-21 22:52 ` Luis R. Rodriguez
2008-07-21 23:55 ` Pavel Roskin
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox