linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@openwrt.org>
To: Julian Calaby <julian.calaby@gmail.com>
Cc: linux-wireless@vger.kernel.org, linville@tuxdriver.com,
	mcgrof@qca.qualcomm.com
Subject: Re: [PATCH] ath9k_hw: make bluetooth coexistence support optional at compile time
Date: Sun, 11 Dec 2011 10:52:05 +0100	[thread overview]
Message-ID: <4EE47D45.4060609@openwrt.org> (raw)
In-Reply-To: <CAGRGNgWVG9gEfwRTcF7V-jzfwVQ3RSoYMHmTSp-SKpsbWo7k6w@mail.gmail.com>

On 2011-12-11 5:20 AM, Julian Calaby wrote:
> Felix,
> 
> On Sun, Dec 11, 2011 at 08:00, Felix Fietkau <nbd@openwrt.org> wrote:
>> Many systems (e.g. embedded systems) do not have wifi modules connected to
>> bluetooth modules, so bluetooth coexistence is irrelevant there. With the
>> addition of MCI support, ath9k picked up quite a bit of extra code that
>> can be compiled out this way.
>>
>> This patch redefines ATH9K_HW_CAP_MCI and adds an inline wrapper for
>> querying the bluetooth coexistence scheme, allowing the compiler to
>> eliminate code that uses it, with only very little use of #ifdef.
>>
>> On MIPS this reduces the total size for the modules by about 20k.
>>
>> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
>> ---
>>
>> diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mci.c b/drivers/net/wireless/ath/ath9k/ar9003_mci.c
>> index 8599822..4905af9 100644
>> --- a/drivers/net/wireless/ath/ath9k/ar9003_mci.c
>> +++ b/drivers/net/wireless/ath/ath9k/ar9003_mci.c
>> @@ -85,6 +85,9 @@ void ar9003_mci_remote_reset(struct ath_hw *ah, bool wait_done)
>>  {
>>        u32 payload[4] = { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffff00};
>>
>> +       if (!ATH9K_HW_CAP_MCI)
>> +               return;
>> +
> 
> IMHO, the checks for ATH9K_HW_CAP_MCI don't make it obvious that
> they're checking whether coexistence is enabled, and are more about
> whether *part* of it is enabled - which could cause confusion if
> another scheme is ever added, or it gets a not-insignificant re-write.
> Surely it wouldn't be too bad to do some #defining around this code
> and in the headers etc. so that the coexistence only functions aren't
> even looked at by the compiler if isn't enabled? IMHO putting the
> btcoex code in #ifdef blocks is better documentation as it's saying
> "these are the btcoex functions, and they're only used if this config
> variable is enabled" not "this random function can be skipped if some
> hardware feature is disabled".
If another different scheme is added, it will be in a separate source
file. I intentionally wanted to avoid compiling out this code using
#ifdef directly, because I want the compiler to check the code for
compile errors, even when it is disabled.

- Felix

  reply	other threads:[~2011-12-11  9:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-10 21:00 [PATCH] ath9k_hw: make bluetooth coexistence support optional at compile time Felix Fietkau
2011-12-11  4:20 ` Julian Calaby
2011-12-11  9:52   ` Felix Fietkau [this message]
2011-12-13 20:28 ` John W. Linville

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=4EE47D45.4060609@openwrt.org \
    --to=nbd@openwrt.org \
    --cc=julian.calaby@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mcgrof@qca.qualcomm.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;
as well as URLs for NNTP newsgroup(s).