public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Bera Yüzlü" <b9788213@gmail.com>
To: andriy.shevchenko@linux.intel.com
Cc: Yeking@red54.com, b9788213@gmail.com, ethantidmore06@gmail.com,
	gregkh@linuxfoundation.org, hansg@kernel.org,
	linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev,
	rayfraytech@gmail.com, straube.linux@gmail.com
Subject: Re: [PATCH] staging: rtl8723bs: remove copy function
Date: Fri, 20 Mar 2026 21:24:38 +0300	[thread overview]
Message-ID: <20260320182437.13948-2-b9788213@gmail.com> (raw)
In-Reply-To: <ab0E5Sp1rGCPrs-E@ashevche-desk.local>

On Fri, 20 Mar 2026 08:27:22 +0000, Andy Shevchenko wrote:
> > void PHY_SetTxPowerLimit( ... )
> >  {
> >  	struct hal_com_data	*pHalData = GET_HAL_DATA(Adapter);
> > -	u8 regulation = 0, bandwidth = 0, rateSection = 0, channel;
> > -	s8 powerLimit = 0, prevPowerLimit, channelIndex;
> > +	u8 regulation = 0, bandwidth = 0, rateSection = 0, channel, powerLimit;
> > +	s8 prevPowerLimit, channelIndex;
> > +	int ret;
> >  
> > -	GetU1ByteIntegerFromStringInDecimal((s8 *)Channel, &channel);
> > -	GetU1ByteIntegerFromStringInDecimal((s8 *)PowerLimit, &powerLimit);
> > +	ret = kstrtou8((const char *)Channel, 10, &channel);
> > +	if (ret)
> > +		return;
> > +
> > +	ret = kstrtou8((const char *)PowerLimit, 10, &powerLimit);
> > +	if (ret)
> > +		return;
> 
> This will change behaviour on the invalid data. Before it was just partially
> converted here and continue, now it breaks an execution. The commit message
> does not explain if it's safe to do or not (i.o.w. if there is a guarantee
> that in current state the input will be always in the correct form).

> Otherwise, you probably want to use one of simple_strtou*().

It only indirectly called from ODM_ReadAndConfig_MP_8723B_TXPWR_LMT() with constant values.
Maybe we can convert this strings to ints so we don't need to do it at runtime.
We can also remove the wrapper odm_ConfigBB_TXPWR_LMT_8723B(). This should be a seperate
patch, right?

Thanks,
Bera

  reply	other threads:[~2026-03-20 18:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-20  7:18 [PATCH] staging: rtl8723bs: remove copy function Bera Yüzlü
2026-03-20  8:25 ` Dan Carpenter
2026-03-20  8:27 ` Andy Shevchenko
2026-03-20 18:24   ` Bera Yüzlü [this message]
2026-03-20 19:19     ` Bera Yüzlü
2026-03-20 19:26       ` Andy Shevchenko

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=20260320182437.13948-2-b9788213@gmail.com \
    --to=b9788213@gmail.com \
    --cc=Yeking@red54.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=ethantidmore06@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hansg@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=rayfraytech@gmail.com \
    --cc=straube.linux@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