From patchwork Sun Feb 7 21:27:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1437265 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ZNt1LBbf; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DYj1L4pLbz9s1l for ; Mon, 8 Feb 2021 08:27:50 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A4E69827F6; Sun, 7 Feb 2021 22:27:27 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ZNt1LBbf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 49A96827D2; Sun, 7 Feb 2021 22:27:19 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8F5908278B for ; Sun, 7 Feb 2021 22:27:13 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x130.google.com with SMTP id y17so10952114ili.12 for ; Sun, 07 Feb 2021 13:27:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aSfqmSRnYXAZVHqfOFGA2VTnbNn5uYxoF6Pw4kEVJkg=; b=ZNt1LBbfV3kaHQtFP9IIxcWWd6cssvhnnBSOFFcABCjqwpDdWxykqjX5ktGSwLwq5r 2FK3c/VBWLuANKBapE0GkkcA1/G6c+oUj0gbwvFKw6/rWzyt6bdJQdmwC7BE+21J89bH NA6dEaVSor503vC8n39OA3afwa1qQGHnp4RAQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aSfqmSRnYXAZVHqfOFGA2VTnbNn5uYxoF6Pw4kEVJkg=; b=PqLGA9EE40XL/jodnK52ROXFwSfVWi2IwGj7B3oRPNQ8y4dUOeuosjBTp2WS9ZkNKT D5weuAzFl6VIZ63qPg9vaaL+QrmDvAwKzf+88t/aUH2yEnnsqX7UtCWhJM/Z7n4ioMY6 mkIi2R+vf3ySuoX/+iTHZ4882iPvxHoRgmeb3XLYA3DVv6rLNx05MNcXlgNRiiJQmsxe /atgEdL5/UshOO4qFjhGhXjmq/h0VXQq7nl7/xQpRz7OMnT99avQqR5Yrdm5sc/n0UbY F0ixeysN0vDxdlQq+hebF75aJmBJaMltStREbEvH34svnIbUdHlIzth01q0LzAqXXG0w XWVw== X-Gm-Message-State: AOAM530kiAY12IhdyBaGGAPdqkuXN3z5tktysXbw56S8vvbUd4O6/wGq +d5lmTkNV0pBVA0GG3ZqS2aR4x9RdLoQJz0k X-Google-Smtp-Source: ABdhPJype1gUU+jbu26kiXTQqmPNAro/arv8mjLBBMY5H7wYXfUKX5xLnoqrw0+GZiTC0ID5OtryCA== X-Received: by 2002:a05:6e02:1b84:: with SMTP id h4mr12517242ili.196.1612733232140; Sun, 07 Feb 2021 13:27:12 -0800 (PST) Received: from localhost.localdomain (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id y11sm7641555ilv.64.2021.02.07.13.27.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Feb 2021 13:27:11 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Heinrich Schuchardt , Simon Glass , Alexander Graf Subject: [PATCH 2/7] efi: Fix compiler warnings Date: Sun, 7 Feb 2021 14:27:02 -0700 Message-Id: <20210207212707.3958570-3-sjg@chromium.org> X-Mailer: git-send-email 2.30.0.478.g8a0d178c01-goog In-Reply-To: <20210207212707.3958570-1-sjg@chromium.org> References: <20210207212707.3958570-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean This occur when building on Raspberry Pi 400 (32-bit ARM). Fix them. Examples: cmd/efidebug.c: In function ‘do_efi_capsule_update’: cmd/efidebug.c:75:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] ret = EFI_CALL(RT->update_capsule(&capsule, 1, (u64)NULL)); ^ include/efi_loader.h:104:9: note: in definition of macro ‘EFI_CALL’ typeof(exp) _r = exp; \ ^~~ cmd/efidebug.c:75:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] ret = EFI_CALL(RT->update_capsule(&capsule, 1, (u64)NULL)); ^ include/efi_loader.h:104:19: note: in definition of macro ‘EFI_CALL’ typeof(exp) _r = exp; \ ^~~ In file included from include/common.h:20, from lib/efi_loader/efi_capsule.c:9: lib/efi_loader/efi_capsule.c: In function ‘efi_update_capsule’: include/efi_loader.h:83:8: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 10 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=] debug("%sEFI: Entry %s(" format ")\n", __efi_nesting_inc(), \ ^~~~~~~~~~~~~~~~~~ include/linux/printk.h:37:21: note: in definition of macro ‘pr_fmt’ #define pr_fmt(fmt) fmt ^~~ include/log.h:229:2: note: in expansion of macro ‘log’ log(LOG_CATEGORY, LOGL_DEBUG, fmt, ##args); \ ^~~ include/log.h:249:2: note: in expansion of macro ‘debug_cond’ debug_cond(_DEBUG, fmt, ##args) ^~~~~~~~~~ include/efi_loader.h:83:2: note: in expansion of macro ‘debug’ debug("%sEFI: Entry %s(" format ")\n", __efi_nesting_inc(), \ ^~~~~ lib/efi_loader/efi_capsule.c:444:2: note: in expansion of macro ‘EFI_ENTRY’ EFI_ENTRY("%p, %lu, %llu\n", capsule_header_array, capsule_count, ^~~~~~~~~ lib/efi_loader/efi_capsule.c:444:19: note: format string is defined here EFI_ENTRY("%p, %lu, %llu\n", capsule_header_array, capsule_count, ~~^ %u Signed-off-by: Simon Glass Reviewed-by: Heinrich Schuchardt --- cmd/efidebug.c | 2 +- lib/efi_loader/efi_capsule.c | 4 ++-- lib/efi_loader/efi_firmware.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/efidebug.c b/cmd/efidebug.c index bbbcb0a5464..09c41c950f7 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -72,7 +72,7 @@ static int do_efi_capsule_update(struct cmd_tbl *cmdtp, int flag, capsule->capsule_image_size); } - ret = EFI_CALL(RT->update_capsule(&capsule, 1, (u64)NULL)); + ret = EFI_CALL(RT->update_capsule(&capsule, 1, (uintptr_t)NULL)); if (ret) { printf("Cannot handle a capsule at %p", capsule); return CMD_RET_FAILURE; diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c index 0d5a7b63ec8..1c0462ceb21 100644 --- a/lib/efi_loader/efi_capsule.c +++ b/lib/efi_loader/efi_capsule.c @@ -441,7 +441,7 @@ efi_status_t EFIAPI efi_update_capsule( unsigned int i; efi_status_t ret; - EFI_ENTRY("%p, %lu, %llu\n", capsule_header_array, capsule_count, + EFI_ENTRY("%p, %zu, %llu\n", capsule_header_array, capsule_count, scatter_gather_list); if (!capsule_count) { @@ -501,7 +501,7 @@ efi_status_t EFIAPI efi_query_capsule_caps( unsigned int i; efi_status_t ret; - EFI_ENTRY("%p, %lu, %p, %p\n", capsule_header_array, capsule_count, + EFI_ENTRY("%p, %zu, %p, %p\n", capsule_header_array, capsule_count, maximum_capsule_size, reset_type); if (!maximum_capsule_size) { diff --git a/lib/efi_loader/efi_firmware.c b/lib/efi_loader/efi_firmware.c index 5e401bbca2b..7a3cca27936 100644 --- a/lib/efi_loader/efi_firmware.c +++ b/lib/efi_loader/efi_firmware.c @@ -299,7 +299,7 @@ efi_status_t EFIAPI efi_firmware_fit_set_image( efi_status_t (*progress)(efi_uintn_t completion), u16 **abort_reason) { - EFI_ENTRY("%p %d %p %ld %p %p %p\n", this, image_index, image, + EFI_ENTRY("%p %d %p %zd %p %p %p\n", this, image_index, image, image_size, vendor_code, progress, abort_reason); if (!image || image_index != 1) @@ -414,7 +414,7 @@ efi_status_t EFIAPI efi_firmware_raw_set_image( efi_status_t status; efi_uintn_t capsule_payload_size; - EFI_ENTRY("%p %d %p %ld %p %p %p\n", this, image_index, image, + EFI_ENTRY("%p %d %p %zd %p %p %p\n", this, image_index, image, image_size, vendor_code, progress, abort_reason); if (!image)