Linux kernel staging patches
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: artur.ugnivenko@gmx.de
Cc: ahmet@sezginduran.net, error27@gmail.com,
	linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev
Subject: Re: [PATCH v9 3/3] staging: rtl8723bs: refactor queue priority initialization
Date: Tue, 7 Jul 2026 11:59:56 +0200	[thread overview]
Message-ID: <2026070724-unsolved-phoney-3b8c@gregkh> (raw)
In-Reply-To: <20260528180757.19082-1-artur.ugnivenko@gmx.de>

On Thu, May 28, 2026 at 08:07:57PM +0200, artur.ugnivenko@gmx.de wrote:
> From: Artur Ugnivenko <artur.ugnivenko@gmx.de>
> 
> Pack individual priority values into an enum-indexed array
> to simplify the initialization code and prevent passing around
> six loose values as function parameters.
> 
> Signed-off-by: Artur Ugnivenko <artur.ugnivenko@gmx.de>
> ---
> Changes in v9:
> - don't declare variables in the middle of functions
> - remove unnecessary whitespace
> Changes in v8:
> - Remove the struct from v7, use an enum-indexed array instead
> - Remove other lines ending in parentheses fixes to keep the
>   commit small
> Changes in v7:
> - Add changelog.
> - Add transmit_queues struct in include/drv_types.h to improve
>   style of _InitNormalChipRegPriority
> Changes in v6: Make the patch apply to gregkh/staging-testing.
> Changes in v5: No changes in this patch.
> Changes in v4: No changes in this patch.
> Changes in v3: Split the patch into multiple patches.
> Changes in v2: Make patch apply to gregkh/staging-testing.
> 
>  drivers/staging/rtl8723bs/hal/sdio_halinit.c  | 105 +++++++++---------
>  drivers/staging/rtl8723bs/include/drv_types.h |  10 ++
>  2 files changed, 62 insertions(+), 53 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/hal/sdio_halinit.c b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
> index 6f2aea984b30..1246c5fdfc32 100644
> --- a/drivers/staging/rtl8723bs/hal/sdio_halinit.c
> +++ b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
> @@ -188,25 +188,18 @@ static void _InitTxBufferBoundary(struct adapter *padapter)
>  	rtw_write8(padapter, REG_TDECTRL + 1, txpktbuf_bndy);
>  }
>  
> -static void _InitNormalChipRegPriority(
> -	struct adapter *Adapter,
> -	u16 beQ,
> -	u16 bkQ,
> -	u16 viQ,
> -	u16 voQ,
> -	u16 mgtQ,
> -	u16 hiQ
> -)
> +static void _InitNormalChipRegPriority(struct adapter *Adapter,
> +				       u16 queues[TX_Q_MAX])

Wow, that's an odd thing to be passing by value in a function, do you
really mean to do this?  Yes, the compiler will let you, but it's not a
good idea to do that at all in the kernel as it messes with the stack,
and all sorts of "odd" things can happen.

Please always pass structures by reference.

Also, you are "open coding" the structure size here, which is not a good
idea as you have to manually keep everything in sync.  What's wrong with
that original structure you used a few versions before?

thanks,

greg k-h

  reply	other threads:[~2026-07-07  9:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-28 17:06 [PATCH v9 0/3] staging: rtl8723bs: fix several style issues in hal/sdio_halinit.c artur.ugnivenko
2026-05-28 17:06 ` [PATCH v9 1/3] staging: rtl8723bs: shorten long lines " artur.ugnivenko
2026-05-28 17:06 ` [PATCH v9 2/3] staging: rtl8723bs: fix inconsistent braces " artur.ugnivenko
2026-05-28 18:07 ` [PATCH v9 3/3] staging: rtl8723bs: refactor queue priority initialization artur.ugnivenko
2026-07-07  9:59   ` Greg KH [this message]
2026-05-29  7:40 ` [PATCH v9 0/3] staging: rtl8723bs: fix several style issues in hal/sdio_halinit.c Dan Carpenter

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=2026070724-unsolved-phoney-3b8c@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=ahmet@sezginduran.net \
    --cc=artur.ugnivenko@gmx.de \
    --cc=error27@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /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