Re: [PATCH] tracing: Remove redundant assignment to variable ret'

From: Lukas Bulwahn
Date: Mon Jan 17 2022 - 02:47:25 EST


Dear Yuntao,


when you consider removing dead-store assignments guided by some static
analyzer, you need to check if the code you are looking at is actually
missing an error-handling branch.

In this case, ftrace_process_locs() may return -ENOMEM, and the caller
needs to appropriately deal with this error return code. Your patch
does not change the code at all, i.e., the compiled object code is the
same as after the patch as before.

Think about how to deal appropriately with the -ENOMEM return in this
caller and submit a patch that implements the right error-handling
branch or argue in your commit message why that is not needed at all.

If you do not understand or cannot check such basic code properties for
dead-store assignments, it might be better to work on some other aspect
and area of the kernel repository. E.g., the kernel documentation build
also has a few warnings that deserve patches to be fixed.


Best regards,

Lukas