From: Andreas Mohr <andi@lisas.de>
To: ath5k-devel@lists.ath5k.org
Cc: linux-wireless@vger.kernel.org, Bob Copeland <me@bobcopeland.com>,
Johannes Stezenbach <js@sig21.net>
Subject: ath5k: ath5k_pci_probe(): weirdo code
Date: Fri, 21 Aug 2009 11:47:32 +0200 [thread overview]
Message-ID: <20090821094732.GA970@rhlx01.hs-esslingen.de> (raw)
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
next reply other threads:[~2009-08-21 9:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-21 9:47 Andreas Mohr [this message]
2009-08-22 13:35 ` ath5k: ath5k_pci_probe(): weirdo code Bob Copeland
2009-08-22 15:10 ` Andreas Mohr
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090821094732.GA970@rhlx01.hs-esslingen.de \
--to=andi@lisas.de \
--cc=ath5k-devel@lists.ath5k.org \
--cc=js@sig21.net \
--cc=linux-wireless@vger.kernel.org \
--cc=me@bobcopeland.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox