From patchwork Sun May 3 18:10:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 1282060 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49FYv557Yzz9sPF for ; Mon, 4 May 2020 04:10:41 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=INWvXaRi; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 49FYv36kwxzDqdG for ; Mon, 4 May 2020 04:10:39 +1000 (AEST) X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=geoff@infradead.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 49FYtc2QZSzDqcY for ; Mon, 4 May 2020 04:10:16 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:References:Cc:To:From: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=ixvRs/MvITXaSDy7uXzPRFZmNwS/ZASf73HpF4fTj2s=; b=INWvXaRiOOh7zNH3rDfArWxCrJ l4rkPxeZiYn0gA5Nl33W05m4dkIl7zvmduq8rvev0H+sg4l/NopGpbZp6OPoP4dm/ABdOMk5suzk/ RpWDb3fe4aY1qTWuEz816TAwOWHk7NOpEOnUeeGqD6hShwnGc7EEkBHz3FiXfCp+okHVoDzk5M/rn cPuPXoFsBddTbFv/KJQXYsDk1cBQ7kSPJMXtON6xx7oyYDhoaYjXJnTb85/D4RfSSZBrBLSvB6tkA 2/BDkrQTzykl7R5dn4k2wpdeyg7G32L8akBLvcW4menroxySq54F36lLwwCm1OXbRhV/tWTzdAHcN X1NCbpMQ==; Received: from [2602:306:37b0:7840:74d2:f789:74e8:9f56] by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jVJ4A-0003Du-1F; Sun, 03 May 2020 18:10:14 +0000 Subject: [PATCH v2 3/5] lib/efi: Fix build warnings From: Geoff Levand To: Jeremy Kerr References: Message-ID: <6d24c7bf-b3fe-9b38-9cb5-48104ab43f47@infradead.org> Date: Sun, 3 May 2020 11:10:05 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: petitboot@lists.ozlabs.org Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" Fixes build warnings like these when building as 32-bit: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘ssize_t’ Signed-off-by: Geoff Levand --- V2: Use '%zd' in format strings. lib/efi/efivar.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/efi/efivar.c b/lib/efi/efivar.c index 37bb6d9..c33e02f 100644 --- a/lib/efi/efivar.c +++ b/lib/efi/efivar.c @@ -34,7 +34,7 @@ #include "talloc/talloc.h" #ifndef EFIVARFS_MAGIC -#define EFIVARFS_MAGIC 0xde5e81e4 +#define EFIVARFS_MAGIC 0xde5e81e4UL #endif void efi_init_mount(struct efi_mount *efi_mount, const char *path, @@ -71,7 +71,7 @@ bool efi_check_mount_magic(const struct efi_mount *efi_mount, bool check_magic) return false; } - if (check_magic && s.f_type != EFIVARFS_MAGIC) { + if (check_magic && ((unsigned long)s.f_type != EFIVARFS_MAGIC)) { pb_debug_fn("Bad magic = 0x%lx\n", (unsigned long)s.f_type); return false; } @@ -182,12 +182,12 @@ int efi_get_variable(void *ctx, const struct efi_mount *efi_mount, if (errno == EAGAIN || errno == EWOULDBLOCK) continue; - pb_log("%s: read failed %s: (%ld) (%d) %s\n", __func__, path, + pb_log("%s: read failed %s: (%zd) (%d) %s\n", __func__, path, count, errno, strerror(errno)); goto exit; } if (p >= (buf + sizeof(buf))) { - pb_log("%s: buffer full %s: (%ld)\n", __func__, path, + pb_log("%s: buffer full %s: (%zd)\n", __func__, path, sizeof(buf)); goto exit; } @@ -241,7 +241,7 @@ int efi_set_variable(const struct efi_mount *efi_mount, const char *name, count = write(fd, buf, bufsize); if ((size_t)count != bufsize) { - pb_log("%s: write failed %s: (%ld) (%d) %s\n", __func__, name, + pb_log("%s: write failed %s: (%zd) (%d) %s\n", __func__, name, count, errno, strerror(errno)); goto exit; }