All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
To: Ping-Ke Shih <pkshih@realtek.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: Jes Sorensen <Jes.Sorensen@gmail.com>
Subject: Re: [PATCH 3/5] wifi: rtl8xxxu: Recognise all possible chip cuts
Date: Fri, 21 Oct 2022 20:36:12 +0300	[thread overview]
Message-ID: <db62da89-8d43-df82-5c41-01fa40244d10@gmail.com> (raw)
In-Reply-To: <4294d0bed5e54862bb199bc2e8e4b6ae@realtek.com>

On 21/10/2022 08:31, Ping-Ke Shih wrote:
> 
> 
>> -----Original Message-----
>> From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
>> Sent: Monday, October 17, 2022 1:30 AM
>> To: linux-wireless@vger.kernel.org
>> Cc: Jes Sorensen <Jes.Sorensen@gmail.com>
>> Subject: [PATCH 3/5] wifi: rtl8xxxu: Recognise all possible chip cuts
>>
>> The chip cut, also known as the chip version, is a letter from A (0)
>> to P (15). Recognise them all instead of printing "unknown" when it's
>> greater than E.
>>
>> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
>> ---
>>  .../wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 27 +++++--------------
>>  1 file changed, 6 insertions(+), 21 deletions(-)
>>
>> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
>> b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
>> index 2efc99896b96..a8914650815e 100644
>> --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
>> +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
>> @@ -1573,31 +1573,16 @@ rtl8xxxu_set_spec_sifs(struct rtl8xxxu_priv *priv, u16 cck, u16 ofdm)
>>
>>  static void rtl8xxxu_print_chipinfo(struct rtl8xxxu_priv *priv)
>>  {
>> +	static const char cuts[16] = "ABCDEFGHIJKLMNOP";
>>  	struct device *dev = &priv->udev->dev;
>> -	char *cut;
>> +	char cut = '?';
>>
>> -	switch (priv->chip_cut) {
>> -	case 0:
>> -		cut = "A";
>> -		break;
>> -	case 1:
>> -		cut = "B";
>> -		break;
>> -	case 2:
>> -		cut = "C";
>> -		break;
>> -	case 3:
>> -		cut = "D";
>> -		break;
>> -	case 4:
>> -		cut = "E";
>> -		break;
>> -	default:
>> -		cut = "unknown";
>> -	}
>> +	/* Currently always true: chip_cut is 4 bits. */
>> +	if (priv->chip_cut <= 15)
>> +		cut = cuts[priv->chip_cut];
> 
> How about?
> 
>    cut = 'A' + priv->chip_cut;
> 
That works too.

  reply	other threads:[~2022-10-21 17:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-16 17:26 [PATCH 1/5] wifi: rtl8xxxu: Add central frequency offset tracking Bitterblue Smith
2022-10-16 17:28 ` [PATCH 2/5] wifi: rtl8xxxu: Fix the CCK RSSI calculation Bitterblue Smith
2022-10-16 17:29 ` [PATCH 3/5] wifi: rtl8xxxu: Recognise all possible chip cuts Bitterblue Smith
2022-10-21  5:31   ` Ping-Ke Shih
2022-10-21 17:36     ` Bitterblue Smith [this message]
2022-10-16 17:30 ` [PATCH 4/5] wifi: rtl8xxxu: Set IEEE80211_HW_SUPPORT_FAST_XMIT Bitterblue Smith
2022-10-16 17:31 ` [PATCH 5/5] wifi: rtl8xxxu: Use dev_info instead of pr_info Bitterblue Smith
2022-10-21  5:47 ` [PATCH 1/5] wifi: rtl8xxxu: Add central frequency offset tracking Ping-Ke Shih
2022-10-21 18:32   ` Bitterblue Smith
2022-10-21 20:22     ` Johannes Berg
2022-10-24  1:48     ` Ping-Ke Shih

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=db62da89-8d43-df82-5c41-01fa40244d10@gmail.com \
    --to=rtl8821cerfe2@gmail.com \
    --cc=Jes.Sorensen@gmail.com \
    --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.