Re: [PATCH v2] staging: rtl8723bs: change custom comparing function to strcmp()

From: Andy Shevchenko

Date: Tue Mar 17 2026 - 04:16:50 EST


On Mon, Mar 09, 2026 at 09:45:56PM +0300, Bera Yüzlü wrote:
> eqNByte() function is a redundant reimplementation of strcmp().
> Remove eqNByte() and switch its usages to strcmp().
> No functional change.

...

> + if (strcmp(Regulation, "FCC") == 0)
> regulation = 0;
> + else if (strcmp(Regulation, "MKK") == 0)
> regulation = 1;
> + else if (strcmp(Regulation, "ETSI") == 0)
> regulation = 2;
> + else if (strcmp(Regulation, "WW13") == 0)
> regulation = 3;

Now you can move it towards match_string().

static const char * const regulations[] = { "FCC", "MKK", "ETSI", "WW13" };

regulation = match_string(regulations, ARRAY_SIZE(regulations), Regulation);
if (regulation < 0)
...ai-ai-ai...

and so on for the rest.

--
With Best Regards,
Andy Shevchenko