On Tue, May 20, 2025 at 10:25:58PM +0800, George Chan via B4 Relay wrote:

> From: George Chan <gchan9...@gmail.com>
> 
> If target u-boot img do not support androidboot v3 or greater,
> abootimg might not be necessary.
> 
> aarch64-linux-gnu-ld.bfd: boot/bootmeth_android.o: in function 
> `boot_android_normal':
> /home/user/sources/u-boot-next/boot/bootmeth_android.c:541:(.text.boot_android_normal+0xd0):
>  undefined reference to `set_avendor_bootimg_addr'
> aarch64-linux-gnu-ld.bfd: 
> /home/user/sources/u-boot-next/boot/bootmeth_android.c:543:(.text.boot_android_normal+0xd8):
>  undefined reference to `set_abootimg_addr'
> Segmentation fault (core dumped)
> 
> Signed-off-by: George Chan <gchan9...@gmail.com>
> ---
>  boot/bootmeth_android.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
[snip]
> @@ -533,6 +533,7 @@ static int boot_android_normal(struct bootflow *bflow)
>       if (ret < 0)
>               return log_msg_ret("read boot", ret);
>  
> +#ifdef CONFIG_CMD_ABOOTIMG
>       if (priv->header_version >= 3) {

Can't we do:
        if (IS_ENABLED(CONFIG_CMD_ABOOTIMG) && priv->header_version >= 3) {
        ..

And then also skip the __maybe_unused?

-- 
Tom

Attachment: signature.asc
Description: PGP signature

Reply via email to