Re: [PATCH 2/2] lsm: rename variable to avoid shadowing
From: Paul Moore
Date: Sat Jan 04 2025 - 22:04:53 EST
On Nov 25, 2024 =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgoettsche@xxxxxxxxxxxxx> wrote:
>
> The function dump_common_audit_data() contains two variables with the
> name comm: one declared at the top and one nested one.
> Rename the nested variable to improve readability and make future refactorings
> of the function less error prone.
>
> Reported by clang:
>
> security/lsm_audit.c:302:10: error: declaration shadows a local variable [-Werror,-Wshadow]
> 302 | char comm[sizeof(tsk->comm)];
> | ^
> security/lsm_audit.c:200:7: note: previous declaration is here
> 200 | char comm[sizeof(current->comm)];
> | ^
>
> Signed-off-by: Christian Göttsche <cgzones@xxxxxxxxxxxxxx>
> ---
> security/lsm_audit.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Merged into lsm/dev, thanks.
--
paul-moore.com