From: Greg KH <gregkh@linuxfoundation.org>
To: "Bera Yüzlü" <b9788213@gmail.com>
Cc: straube.linux@gmail.com, Yeking@red54.com, hansg@kernel.org,
andriy.shevchenko@linux.intel.com, ethantidmore06@gmail.com,
weibu@redadmin.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: change custom comparing function to memcmp()
Date: Mon, 9 Mar 2026 17:12:00 +0100 [thread overview]
Message-ID: <2026030932-caretaker-reemerge-5b71@gregkh> (raw)
In-Reply-To: <20260227200637.47130-1-b9788213@gmail.com>
On Fri, Feb 27, 2026 at 11:06:37PM +0300, Bera Yüzlü wrote:
> eqNByte() function is a redundant reimplementation of memcmp().
> Remove eqNByte() and switch its usages to memcmp().
> No functional change.
>
> Signed-off-by: Bera Yüzlü <b9788213@gmail.com>
> ---
> drivers/staging/rtl8723bs/hal/hal_com.c | 12 ------------
> .../staging/rtl8723bs/hal/hal_com_phycfg.c | 19 ++++++++++---------
> drivers/staging/rtl8723bs/include/hal_com.h | 2 --
> 3 files changed, 10 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
> index 31b3e880ae6a..a7720f821823 100644
> --- a/drivers/staging/rtl8723bs/hal/hal_com.c
> +++ b/drivers/staging/rtl8723bs/hal/hal_com.c
> @@ -750,18 +750,6 @@ void SetHalODMVar(
> }
>
>
> -bool eqNByte(u8 *str1, u8 *str2, u32 num)
> -{
> - if (num == 0)
> - return false;
> - while (num > 0) {
> - num--;
> - if (str1[num] != str2[num])
> - return false;
> - }
> - return true;
> -}
> -
> bool GetU1ByteIntegerFromStringInDecimal(char *Str, u8 *pInt)
> {
> u16 i = 0;
> diff --git a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
> index dc2da49e6738..b5ba3eba597b 100644
> --- a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
> +++ b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
> @@ -8,6 +8,7 @@
> #include <drv_types.h>
> #include <hal_data.h>
> #include <linux/kernel.h>
> +#include <linux/string.h>
>
> u8 PHY_GetTxPowerByRateBase(struct adapter *Adapter, u8 RfPath,
> enum rate_section RateSection)
> @@ -819,27 +820,27 @@ void PHY_SetTxPowerLimit(
>
> powerLimit = powerLimit > MAX_POWER_INDEX ? MAX_POWER_INDEX : powerLimit;
>
> - if (eqNByte(Regulation, (u8 *)("FCC"), 3))
> + if (memcmp(Regulation, "FCC", 3) == 0)
> regulation = 0;
This should all be calls to strcmp() instead, right? These are strings,
please treat them as such.
thanks,
greg k-h
prev parent reply other threads:[~2026-03-09 16:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-27 20:06 [PATCH] staging: rtl8723bs: change custom comparing function to memcmp() Bera Yüzlü
2026-02-28 10:41 ` Andy Shevchenko
2026-03-09 16:12 ` Greg KH [this message]
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=2026030932-caretaker-reemerge-5b71@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=Yeking@red54.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=b9788213@gmail.com \
--cc=ethantidmore06@gmail.com \
--cc=hansg@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=straube.linux@gmail.com \
--cc=weibu@redadmin.org \
/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