From patchwork Mon Apr 27 03:38:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 1277299 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 499VrB0wtSz9sRY for ; Mon, 27 Apr 2020 13:39:06 +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=merlin.20170209 header.b=WCngNy9o; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 499Vr96cRbzDqLG for ; Mon, 27 Apr 2020 13:39:05 +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=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=geoff@infradead.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=WCngNy9o; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (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 499Vqg06x6zDqVF for ; Mon, 27 Apr 2020 13:38:38 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Date:Cc:To:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:From:References:In-Reply-To:Message-Id: Sender:Reply-To:Content-ID:Content-Description; bh=R/nWLLY6CppyT83Cfx5RAo5lprR59+uzfBpcr8YRtqw=; b=WCngNy9oMal9rQ2/PZYgDuc7Cv Qvr3aj4BQ+WfVJvM+8KhoseUF7WYZHssYelq66Gn250IWSq2aVt9IiMcc66rGUNjNk19lnXUkbnmA QYWIZ6+Obu16BFr0lmxovh3cVTH/z9nlQN/L2XPz8t3Hq/HY9T5Q0lI6FUj99N8o3MZ5zL89mW1iN gRAPHVOhSQIHI7GylWSLc5ujeLj7wvZnQBq7PbhAjz9yiAudeWlsLuA8lN70MYUKJ3Scg8FA+Awwh ogiQdZt2woRiiBGytAiD9dskQSE0TBPsl2HbNkdNN8bANqaTHOW6TG+afx62UMUbc/02nobXqF7h1 OJc+T7tw==; Received: from geoff by merlin.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jSubH-0005VR-4n; Mon, 27 Apr 2020 03:38:31 +0000 Message-Id: In-Reply-To: References: From: Geoff Levand Patch-Date: Sun, 26 Apr 2020 20:14:07 -0700 Subject: [PATCH v1 3/5] lib/efi: Fix build warnings MIME-Version: 1.0 To: Jeremy Kerr Date: Mon, 27 Apr 2020 03:38:31 +0000 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 --- 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..75863ba 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; } @@ -183,12 +183,12 @@ int efi_get_variable(void *ctx, const struct efi_mount *efi_mount, continue; pb_log("%s: read failed %s: (%ld) (%d) %s\n", __func__, path, - count, errno, strerror(errno)); + (long int)count, errno, strerror(errno)); goto exit; } if (p >= (buf + sizeof(buf))) { pb_log("%s: buffer full %s: (%ld)\n", __func__, path, - sizeof(buf)); + (long int)sizeof(buf)); goto exit; } if (count == 0) @@ -242,7 +242,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, - count, errno, strerror(errno)); + (long int)count, errno, strerror(errno)); goto exit; } rc = 0;