mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
common/efi: fix Rule 2.1 violation in read_file()
MISRA C Rule 2.1 states: "A project shall not contain unreachable code."
The final return statement in the 'read_file()' function is unreachable
due to function 'PrintErrMesg()' which has 'noreturn' attribute:
PrintErrMesg(name, ret);
/* not reached */
return false;
}
No explicit return statement is needed here because 'PrintErrMesg()' is
marked as 'noreturn', which guarantees that it never returns control to
the caller. If the 'noreturn' attribute of 'PrintErrMesg()' is removed
in the future, compiler will emit an error about the missing return
statement (build-time safeguard).
No functional changes.
Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
Reviewed-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
This commit is contained in:
1 parent
e28d97d598
commit
9e5a9b53f6
1 file changed
-1
@@ -853,7 +853,6 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
|
||||
PrintErrMesg(name, ret);
|
||||
|
||||
/* not reached */
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool __init read_section(const EFI_LOADED_IMAGE *image,
|
||||
|
||||