[PATCH 2/2] lsm: rename variable to avoid shadowing
Paul Moore
paul at paul-moore.com
Sun Jan 5 03:04:38 UTC 2025
On Nov 25, 2024 =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgoettsche at seltendoof.de> 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 at googlemail.com>
> ---
> security/lsm_audit.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Merged into lsm/dev, thanks.
--
paul-moore.com
More information about the Linux-security-module-archive
mailing list