linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ath5k: ath5k_pci_probe(): weirdo code
@ 2009-08-21  9:47 Andreas Mohr
  2009-08-22 13:35 ` Bob Copeland
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Mohr @ 2009-08-21  9:47 UTC (permalink / raw)
  To: ath5k-devel; +Cc: linux-wireless, Bob Copeland, Johannes Stezenbach

Hello all,

that 2GHz/5GHz radio information code in ath5k_pci_probe() in 2.6.31-rc6 source
seems VERY weird.
ah_radio_5ghz_revision/ah_radio_2ghz_revision conditional evaluation seems
completely bonkered in several places, unless something is escaping on
me.
Then also at this place, why is there no
else
{
  WARN_ONCE(...); // Huh. Unknown/unhandled/impossible revision combo
}
branch at the end? (or something less incinerating)
I've had my few lessons about defensive programming...
(and applying such stuff liberally in this entire driver wouldn't hurt either)


The

        if (!sc->ah->ah_single_chip) {
                /* Single chip radio (!RF5111) */

part seemed weird logic, too, but I then thought that this code section
is perhaps _intended_ to be skipped in this case, to simply not log anything
for single-chip radios
(but the comment above would be very insufficient/confusing if that is
the case, and if the entire weird section is _actually_ correct as it stands
then even lots more rectifying comments about this strange evaluation
being correct are missing).

Could anyone enlighten me?
So far it looks like a large part of this code is buggy, but I could be
wrong.



BTW, I'm currently on 2.6.31-rc6 on Aspire One, with even more ath5k problems
than before, connection is dying every couple minutes, extended to every
couple dozen minutes if I force rate 1M
(but it looks like "[Bug #13948] ath5k broken after suspend-to-ram"
http://lkml.org/lkml/2009/8/19/468 is hopefully covering these issues already).
And I do have CONFIG..._PS (powersave) enabled by default...
And I do make liberal use of suspend-to-ram, as should everyone.

Thanks,

Andreas Mohr

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-08-22 15:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-21  9:47 ath5k: ath5k_pci_probe(): weirdo code Andreas Mohr
2009-08-22 13:35 ` Bob Copeland
2009-08-22 15:10   ` Andreas Mohr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).