public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: Luka Gejak <luka.gejak@linux.dev>
To: Salman Alghamdi <me@cipherat.com>
Cc: gregkh@linuxfoundation.org, straube.linux@gmail.com,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	luka.gejak@linux.dev
Subject: Re: [PATCH v2] staging: rtl8723bs: rtw_mlme: fix line length warnings
Date: Sun, 26 Apr 2026 08:48:47 +0200	[thread overview]
Message-ID: <8A10E55D-24E2-4569-96E9-2F18C115779D@linux.dev> (raw)
In-Reply-To: <74615568-5FCA-4674-BE30-EEB48165E662@linux.dev>

On April 26, 2026 8:37:28 AM GMT+02:00, Luka Gejak <luka.gejak@linux.dev> wrote:
>On April 26, 2026 4:33:23 AM GMT+02:00, Salman Alghamdi <me@cipherat.com> wrote:

...

>>>
>>> Put u8 *ie ... here, under update_network.
>>>
>>
>>Should variables always be declared at the nearest enclosing scope
>>where they're used, or at the top of the function?
>
>Generally nearest scope, but in this case you should declare u8 *ie 
>inside the block and after update_network(), because by doing that you
>ensure the pointer is initialized with the freshest data. It also 
>prevents the variable from being used elsewhere in the function where 
>it might be invalid.
>

Forgot to mention one thing, if your variable is used in both block
(e.g. both inside if and else blocks), then it should be declared in 
the outher scope.

...

Best regards,
Luka Gejak

      reply	other threads:[~2026-04-26  6:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-25 16:56 [PATCH v2] staging: rtl8723bs: rtw_mlme: fix line length warnings Salman Alghamdi
2026-04-25 19:12 ` Luka Gejak
2026-04-26  2:33   ` Salman Alghamdi
2026-04-26  6:37     ` Luka Gejak
2026-04-26  6:48       ` Luka Gejak [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=8A10E55D-24E2-4569-96E9-2F18C115779D@linux.dev \
    --to=luka.gejak@linux.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=me@cipherat.com \
    --cc=straube.linux@gmail.com \
    /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