linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Yogesh Hegde <yogi.kernel@gmail.com>
Cc: philipp.g.hortmann@gmail.com, dragan.m.cvetic@gmail.com,
	wjsota@gmail.com, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8192e: Rename variables TM_Trigger and TxPowerCheckCnt to avoid CamelCase
Date: Sun, 6 Nov 2022 17:40:05 +0100	[thread overview]
Message-ID: <Y2fjZbZdoZE86u50@kroah.com> (raw)
In-Reply-To: <20221106131811.GA50668@zephyrus>

On Sun, Nov 06, 2022 at 06:48:11PM +0530, Yogesh Hegde wrote:
> Rename variables
> * TM_trigger to tm_trigger
> * TxPowerCheckCnt to txpower_check_count
> to avoid CamelCase which is not accepted by checkpatch.pl .
> 
> Signed-off-by: Yogesh Hegde <yogi.kernel@gmail.com>
> ---
>  drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
> index 767c746fc73d..0652940eecc5 100644
> --- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
> +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
> @@ -919,32 +919,32 @@ static void _rtl92e_dm_check_tx_power_tracking_tssi(struct net_device *dev)
>  static void _rtl92e_dm_check_tx_power_tracking_thermal(struct net_device *dev)
>  {
>  	struct r8192_priv *priv = rtllib_priv(dev);
> -	static u8	TM_Trigger;
> -	u8		TxPowerCheckCnt = 0;
> +	static u8 tm_trigger;
> +	u8 txpower_check_count = 0;

While this is nice overall, I think you just found a bug in the driver.

Why is this a static variable?  That means this affects all devices that
this driver touches, which seems very wrong, right?

So shouldn't tm_trigger be a per-device attribute?

>  	if (IS_HARDWARE_TYPE_8192SE(dev))
> -		TxPowerCheckCnt = 5;
> +		txpower_check_count = 5;
>  	else
> -		TxPowerCheckCnt = 2;
> +		txpower_check_count = 2;
>  	if (!priv->btxpower_tracking)
>  		return;
>  
> -	if (priv->txpower_count  <= TxPowerCheckCnt) {
> +	if (priv->txpower_count  <= txpower_check_count) {
>  		priv->txpower_count++;
>  		return;
>  	}
>  
> -	if (!TM_Trigger) {
> +	if (!tm_trigger) {
>  		rtl92e_set_rf_reg(dev, RF90_PATH_A, 0x02, bMask12Bits, 0x4d);
>  		rtl92e_set_rf_reg(dev, RF90_PATH_A, 0x02, bMask12Bits, 0x4f);
>  		rtl92e_set_rf_reg(dev, RF90_PATH_A, 0x02, bMask12Bits, 0x4d);
>  		rtl92e_set_rf_reg(dev, RF90_PATH_A, 0x02, bMask12Bits, 0x4f);
> -		TM_Trigger = 1;
> +		tm_trigger = 1;

It also should be a boolean, right?

Can you fix this up to be a per-device attribute instead?

thanks,

greg k-h

  reply	other threads:[~2022-11-06 16:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-06 13:18 [PATCH] staging: rtl8192e: Rename variables TM_Trigger and TxPowerCheckCnt to avoid CamelCase Yogesh Hegde
2022-11-06 16:40 ` Greg KH [this message]
2022-11-06 17:47   ` Yogesh Hegde

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=Y2fjZbZdoZE86u50@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=dragan.m.cvetic@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=philipp.g.hortmann@gmail.com \
    --cc=wjsota@gmail.com \
    --cc=yogi.kernel@gmail.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).