Re: [PATCH] staging: rtl8723bs: remove copy function
From: Bera Yüzlü
Date: Fri Mar 20 2026 - 15:20:54 EST
On Fri, 20 Mar 2026 11:25:08 -0700, Bera Yüzlü wrote:
> 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
Just noticed ODM_ReadAndConfig_MP_8723B_TXPWR_LMT() didn't called anywhere.
I will remove:
GetU1ByteIntegerFromStringInDecimal()
PHY_SetTxPowerLimit()
odm_ConfigBB_TXPWR_LMT_8723B()
ODM_ReadAndConfig_MP_8723B_TXPWR_LMT()
in v2. They are all unusued.
Thanks,
Bera.