Re: [PATCH] staging: rtl8723bs: remove copy function

From: Bera Yüzlü

Date: Fri Mar 20 2026 - 14:26:38 EST


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