All of lore.kernel.org
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: pkshih@realtek.com, kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH 1/9] rtlwifi: btcoex: Add 8822b1ant coex files
Date: Tue, 3 Apr 2018 21:43:15 -0500	[thread overview]
Message-ID: <f4d2fe50-76b0-27a8-a119-018d7d7d1286@lwfinger.net> (raw)
In-Reply-To: <20180328072741.23349-2-pkshih@realtek.com>

On 03/28/2018 02:27 AM, pkshih@realtek.com wrote:
> From: Ping-Ke Shih <pkshih@realtek.com>
> 
> This file supports 8822be WiFi module with two physical antenna that
> means one antenna will share with BT.
> 
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
> ---
>   .../realtek/rtlwifi/btcoexist/halbtc8822b1ant.c    | 5303 ++++++++++++++++++++
>   .../realtek/rtlwifi/btcoexist/halbtc8822b1ant.h    |  413 ++
>   2 files changed, 5716 insertions(+)
>   create mode 100644 drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8822b1ant.c
>   create mode 100644 drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8822b1ant.h

--snip--

> +/*anttenna control by bb mac bt antdiv pta to write 0x4c 0xcb4,0xcbd*/
> +
> +static
> +void hallbtc882b1ant_set_ant_switch(struct btc_coexist *btcoexist,
> +				    bool force_exec, u8 ctrl_type,
> +				    u8 pos_type)
> +{
> +	struct rtl_priv *rtlpriv = btcoexist->adapter;
> +	bool switch_polatiry_inverse = false;
> +	u8 regval_0xcbd = 0, regval_0x64;
> +	u32 u32tmp1 = 0, u32tmp2 = 0, u32tmp3 = 0;
> +
> +	/* Ext switch buffer mux */
> +	btcoexist->btc_write_1byte(btcoexist, 0x974, 0xff);
> +	btcoexist->btc_write_1byte_bitmask(btcoexist, 0x1991, 0x3, 0x0);
> +	btcoexist->btc_write_1byte_bitmask(btcoexist, 0xcbe, 0x8, 0x0);
> +
> +	if (!rfe_type->ext_ant_switch_exist)
> +		return;
> +
> +	coex_dm->cur_ext_ant_switch_status = (ctrl_type << 8) + pos_type;
> +
> +	if (!force_exec) {
> +		if (coex_dm->pre_ext_ant_switch_status ==
> +		    coex_dm->cur_ext_ant_switch_status)
> +			return;
> +	}
> +
> +	coex_dm->pre_ext_ant_switch_status = coex_dm->cur_ext_ant_switch_status;
> +
> +	/* swap control polarity if use different switch control polarity*/
> +	/* Normal switch polarity for SPDT,
> +	 * 0xcbd[1:0] = 2b'01 => Ant to BTG, WLA
> +	 * 0xcbd[1:0] = 2b'10 => Ant to WLG
> +	 */
> +	switch_polatiry_inverse = (rfe_type->ext_ant_switch_ctrl_polarity == 1 ?
> +					   ~switch_polatiry_inverse :
> +					   switch_polatiry_inverse);

gcc 7.3.1 reports the following:

   CC [M]  drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8822b1ant.o
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8822b1ant.c: In function 
‘hallbtc882b1ant_set_ant_switch’:
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8822b1ant.c:2193:9: 
warning: ‘~’ on a boolean expression [-Wbool-operation]
          ~switch_polatiry_inverse :
          ^
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8822b1ant.c:2193:9: note: 
did you mean to use logical not?
          ~switch_polatiry_inverse :
          ^

For a boolean, you should use !bool, not -bool. In addition, it would be better 
to use switch_polarity_inverse, not switch_polatiry_inverse. The same "typo" 
happens in other places in this file. I suggest

sed -i 's/polatiry_inverse/polarity_inverse/g' \
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8822b1ant.c.

> +
> +	switch (pos_type) {

Larry

  reply	other threads:[~2018-04-04  2:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28  7:27 [PATCH 0/9] rtlwifi: btcoex: Add 8822b btcoex support pkshih
2018-03-28  7:27 ` [PATCH 1/9] rtlwifi: btcoex: Add 8822b1ant coex files pkshih
2018-04-04  2:43   ` Larry Finger [this message]
2018-04-04 12:41     ` Pkshih
2018-04-04 12:45       ` Pkshih
2018-03-28  7:27 ` [PATCH 2/9] rtlwifi: btcoex: Add 8822b2ant " pkshih
2018-03-28  7:27 ` [PATCH 3/9] rtlwifi: btcoex: Add 8822b header files to precomp.h pkshih
2018-03-28  7:27 ` [PATCH 4/9] rtlwifi: btcoex: Add 8822b routine to btc interfaces pkshih
2018-03-28  7:27 ` [PATCH 5/9] rtlwifi: btcoex: Add 8822b to Makefile pkshih
2018-03-28  7:27 ` [PATCH 6/9] rtlwifi: btcoex: remove comments that are not meaningful pkshih
2018-03-28  7:27 ` [PATCH 7/9] rtlwifi: btcoex: Add modifier const to version related variables pkshih
2018-03-28 14:35   ` Kalle Valo
2018-03-28  7:27 ` [PATCH 8/9] rtlwifi: btcoex: Add struct members to replace global varaibles pkshih
2018-03-28  7:27 ` [PATCH 9/9] rtlwifi: btcoex: Remove global variables of chip specific context pkshih

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=f4d2fe50-76b0-27a8-a119-018d7d7d1286@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pkshih@realtek.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.