mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Leonardo Martins Martins <dev.lmmrtns@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	 Leonardo Martins Martins <dev.lmmrtns@gmail.com>
Subject: [PATCH v2 0/3] staging: rtl8723bs: refactor PHY_ConvertTxPowerLimitToPowerIndex()
Date: Fri, 02 Oct 2026 01:07:34 -0300	[thread overview]
Message-ID: <20261002-rtl8723bs-tx-pwr-limit-v2-0-48b180fb6f7f@gmail.com> (raw)

The function PHY_ConvertTxPowerLimitToPowerIndex() has several style
problems, such as mixed-case names, deeply nested code, and redundant
bounds checking.

Patch 1 renames mixed-case variables that are on the same scope as this
function, struct fields such as TxPwrLimit_2_4G were left as is. Patch 2
removes redundant parts of the code, and patch 3 solves the nesting
issue by extracting the inner loop into an auxiliary function like it is
done in rtw_phy_tx_power_limit_config(), at
drivers/net/wireless/realtek/rtw88/phy.c

Checkpatch issues a few warnings and checks for deep nesting and long
lines, but these are solved by the last patch.

Compile tested only.

Signed-off-by: Leonardo Martins Martins <dev.lmmrtns@gmail.com>
---
Changes in v2:
- Rebase on staging-testing and drop the patch that was already applied:
  "staging: rtl8723bs: rename PHY_ConvertTxPowerLimitToPowerIndex()"
- Dropped these two name changes, keeping the original names:
	regulation -> reg
	channel -> ch
- Link to v1: https://lore.kernel.org/r/20260926-rtl8723bs-tx-pwr-limit-v1-0-989dcbc113fd@gmail.com

---
Leonardo Martins Martins (3):
      staging: rtl8723bs: rename local vars in phy_tx_power_limit_to_index()
      staging: rtl8723bs: access TxPowerByRateBase2_4G directly
      staging: rtl8723bs: extract inner loop in phy_tx_power_limit_to_index()

 drivers/staging/rtl8723bs/hal/hal_com_phycfg.c     | 87 ++++++++--------------
 drivers/staging/rtl8723bs/include/hal_com_phycfg.h |  3 -
 2 files changed, 30 insertions(+), 60 deletions(-)
---
base-commit: dbc2fa996f44602af72ea56efa68c043407eaaac
change-id: 20260922-rtl8723bs-tx-pwr-limit-9a19bb9f901e

Best regards,
-- 
Leonardo Martins Martins <dev.lmmrtns@gmail.com>


             reply	other threads:[~2026-10-02  4:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02  4:07 Leonardo Martins Martins [this message]
2026-10-02  4:07 ` [PATCH v2 1/3] staging: rtl8723bs: rename local vars in phy_tx_power_limit_to_index() Leonardo Martins Martins
2026-10-02  6:09   ` Greg Kroah-Hartman
2026-10-02  7:30     ` Leonardo Martins Martins
2026-10-02  4:07 ` [PATCH v2 2/3] staging: rtl8723bs: access TxPowerByRateBase2_4G directly Leonardo Martins Martins
2026-10-02  4:07 ` [PATCH v2 3/3] staging: rtl8723bs: extract inner loop in phy_tx_power_limit_to_index() Leonardo Martins Martins
2026-10-02  6:10 ` [PATCH v2 0/3] staging: rtl8723bs: refactor PHY_ConvertTxPowerLimitToPowerIndex() Greg Kroah-Hartman
2026-10-02  7:39   ` Leonardo Martins Martins
2026-10-02  7:55     ` Greg Kroah-Hartman

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=20261002-rtl8723bs-tx-pwr-limit-v2-0-48b180fb6f7f@gmail.com \
    --to=dev.lmmrtns@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /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

all inboxes | Powered by JetHome®