Re: [PATCH v2] ALSA: core/seq: Optimize the return logic in cc_ev_to_ump_midi2
From: Takashi Iwai
Date: Fri Mar 27 2026 - 07:48:44 EST
On Wed, 25 Mar 2026 02:51:19 +0100,
songxiebing wrote:
>
> There are multiple early return branches within the func, and compiler
> optimizations(such as -O2/-O3)lead to abnormal stack frame analysis -
> objtool cannot comfirm that the stack frames of all branches can be
> correctly restored, thus generating false warnings.
>
> Below:
> >> sound/core/seq/seq_ump_convert.o: warning: objtool: cc_ev_to_ump_midi2+0x589: return with modified stack frame
>
> So we modify it by uniformly returning at the and of the function.
>
> Signed-off-by: songxiebing <songxiebing@xxxxxxxxxx>
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Closes: https://lore.kernel.org/oe-kbuild-all/202503200535.J3hAvcjw-lkp@xxxxxxxxx/
> ---
> v2:
> - fix warning: this statement may fall through [-Wimplicit-fallthrough=]
Basically I don't like to take this kind of change just because a
stupid compiler can't handle it well. But this particular code change
itself is simple enough, so maybe still worth to take.
Applied to for-next branch now. Thanks.
Takashi