On 07.03.2022 22:02, Andrew Cooper wrote:
> kexec_reloc() does not return.  Plumbing this property upwards lets us mark
> machine_kexec() and machine_reboot_kexec() noreturn too.  This in turn lets us
> drop some unreachable BUG()/return statements.

I'm certainly fine with the added attributes. I'm less convinced of the
removal of BUG() - I'd prefer to leave to the compiler elimination of
these when found to be dead, just to be on the safe side. And I'm pretty
uncertain about the removal of "return", when it comes to old enough
compilers.

> @@ -403,9 +401,6 @@ static long cf_check kexec_reboot(void *_image)
>  
>      kexec_common_shutdown();
>      machine_reboot_kexec(image);
> -
> -    BUG();
> -    return 0;
>  }

In principle this function now is also "noreturn", but I think I
vaguely recall some compilers warning about "noreturn" when a function
returns other than void.

Jan


Reply via email to