Re: [PATCH v2] staging: rtl8723bs: rtw_mlme: fix line length warnings

Luka Gejak
2026-04-26T06:48:53Z

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