From patchwork Fri May 28 01:47:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 449475 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp1034376jac; Thu, 27 May 2021 18:47:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3RLEodaVn+KNqQjzF1vTFnkgW9ON9TyNOOEFRPuSQ/Odfu4VI93xGwT4il/Yh8yqG1C1e X-Received: by 2002:a05:6402:da:: with SMTP id i26mr7466560edu.379.1622166442618; Thu, 27 May 2021 18:47:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622166442; cv=none; d=google.com; s=arc-20160816; b=EknCTtSIkmzxoEZesHStoL01m9OityqHY8YL6g2AalII1fkNmt5CFB5huqvSbOtI1a iqzU3JqFHDjQzj26jkY9spRZ5pj8IA+INjNKfqkoJMQReFPAK52r2aYRTvKuQxyIhuvq dCG8VO1f8GSFM0AP3bHrPY40QUhvKWzJ1PfrSegIuDu8t0ZZfEl+xkzYIo2CPMqdqztM 5I6tjhOB3asJs03P4kgmtmy9WWux2h+zqMZWI2pw7xBy4SxNIq8byTLyabAlG+OR5v1Z jj4jTo/h1xd9e/zmhHoReSgCWs35nHmXLB52GFnTH7fIxlibT6duAcnw4kjWCKrGvUA+ 66hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=aGScMP/P4odcLIeP1rwTJ5TTobc22ix9bh6oXMVBC4Q=; b=jWmvTVLCC6QhmFYb8bl8DqPv5URB2sWvAqpgSyOpcrQPjq/TG9FYXZ+Hz+Gz+6U9C6 BAv/QDXIObUdJW3TUsMeIn5ak1oxc7sdc4ozAENceVcUZhsSY7pKysW1S0qPYKGXV4EQ Gc/2XiLkk2QstyXR3QlYRKOWzzLXgRndQ3hJ1ZMV2VrxXrzRPIrq5sC+BpoIlWS+L77V HIlrOTp0S3mvd23iTHs56vAE7hc76yASCG8e9WKjw6r2joMwVKl9eTgidMlc5wENeV5k 1OpwaE93kikNW5emu7hVAxusoAkW/sqh1bXPP91JP7xMFgV8Zw+RhXlKNIrB5Nln9bXc AtiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JkcmoaH2; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id w9si4033962edc.430.2021.05.27.18.47.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 May 2021 18:47:22 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JkcmoaH2; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4D80282CFA; Fri, 28 May 2021 03:47:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="JkcmoaH2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2AF3282CAC; Fri, 28 May 2021 03:47:18 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) (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 2CEE982CAC for ; Fri, 28 May 2021 03:47:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masahisa.kojima@linaro.org Received: by mail-pg1-x531.google.com with SMTP id 6so1363509pgk.5 for ; Thu, 27 May 2021 18:47:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=aGScMP/P4odcLIeP1rwTJ5TTobc22ix9bh6oXMVBC4Q=; b=JkcmoaH21Q5mNXI9Swfrp/ZxnHZAjDa8GlbSpCZiZnWZ+Bu17+JalfZAdFzFKQUnVV h3DL8pa3d2o1TVZQuXmG7VE5fYJpNW8317V1XD5IV8OAslT1LWlDBpMMUadJZWjliIra AMLMKZWy1ZwvY852VHQIMeLfhSbpWcU+FxEx27rDRpBJiCAATHnaDi0blSMSkhTe0Ns4 SkoTK53K89nQ8yjGp2RpKgK/Zd9nARp+PriHXArh9LRobG1xsTcXfyW7OyHQqsn4/f6f AKZ0TNHcHkJ/tSXPePrlnDZf6n0jfrlYK1vZBVrxgMoe4xRAb+eez3L0VtCpx8ve7jgD pYIg== 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; bh=aGScMP/P4odcLIeP1rwTJ5TTobc22ix9bh6oXMVBC4Q=; b=JlRFJFgKpsRMtI7udayk4BCEAlQccY5jYrbj87YoC31h4sBI3tkDpgTyhs+YP7X64e rqrY+p+/bFLCRghuv+/SMijjHsPRCxdf9E6yuNifaNUVw6wEK4DXrfHQuXAvaI0xiH27 ZEAUUnGTz2qr1CUhRUbPYwIy6Ps4GRUsXDjXVVzadNlLsfp7q6RBBCkhF3SZcj8wf/UV DaWo5Rsvi7rMWO8ovG6J2+R9xySEYnt/6zNFpdmCgsWsyXbFeMi6r9MvXa07dk+Q5mN5 2SchKbrGtDOgYKGvGWQk5TDe7VxvjJlQotq6i+J1b0AevWfM4nYdjBFf7/HRhBudCFSQ 8U7g== X-Gm-Message-State: AOAM531I8glCUwDxxYLSWjN/jUd2n342XeedLtS7mUiRpbD7tiqy1k8i yShiIzTwni132WZaZup9z7koVw== X-Received: by 2002:a65:6256:: with SMTP id q22mr6480280pgv.391.1622166433335; Thu, 27 May 2021 18:47:13 -0700 (PDT) Received: from localhost.localdomain ([2400:2411:502:a100:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id v2sm2777091pfm.134.2021.05.27.18.47.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 May 2021 18:47:12 -0700 (PDT) From: Masahisa Kojima To: Heinrich Schuchardt Cc: Alexander Graf , Ilias Apalodimas , u-boot@lists.denx.de Subject: [PATCH] efi_loader: build warning in efi_tcg2.c Date: Fri, 28 May 2021 10:47:48 +0900 Message-Id: <20210528014748.24504-1-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 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.4 at phobos.denx.de X-Virus-Status: Clean Building 32bit boards with the TCG2 protocol enabled leads to a build warning due to a missing conversion. lib/efi_loader/efi_tcg2.c: In function 'tcg2_measure_pe_image': lib/efi_loader/efi_tcg2.c:856:47: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] 856 | image_load_event->image_location_in_memory = (efi_physical_addr_t)efi; | ^ lib/efi_loader/efi_tcg2.c: In function 'efi_tcg2_hash_log_extend_event': lib/efi_loader/efi_tcg2.c:947:22: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 947 | ret = efi_check_pe((void *)data_to_hash, data_to_hash_len, | ^ lib/efi_loader/efi_tcg2.c:953:28: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 953 | ret = tcg2_hash_pe_image((void *)data_to_hash, data_to_hash_len, | ^ Signed-off-by: Masahisa Kojima --- lib/efi_loader/efi_tcg2.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c index 3dd417aa27..47bc371477 100644 --- a/lib/efi_loader/efi_tcg2.c +++ b/lib/efi_loader/efi_tcg2.c @@ -853,7 +853,7 @@ efi_status_t tcg2_measure_pe_image(void *efi, u64 efi_size, if (!image_load_event) return EFI_OUT_OF_RESOURCES; - image_load_event->image_location_in_memory = (efi_physical_addr_t)efi; + image_load_event->image_location_in_memory = (uintptr_t)efi; image_load_event->image_length_in_memory = efi_size; image_load_event->length_of_device_path = device_path_length; @@ -944,14 +944,14 @@ efi_tcg2_hash_log_extend_event(struct efi_tcg2_protocol *this, u64 flags, if (flags & PE_COFF_IMAGE) { IMAGE_NT_HEADERS32 *nt; - ret = efi_check_pe((void *)data_to_hash, data_to_hash_len, - (void **)&nt); + ret = efi_check_pe((void *)(uintptr_t)data_to_hash, + data_to_hash_len, (void **)&nt); if (ret != EFI_SUCCESS) { log_err("Not a valid PE-COFF file\n"); goto out; } - ret = tcg2_hash_pe_image((void *)data_to_hash, data_to_hash_len, - &digest_list); + ret = tcg2_hash_pe_image((void *)(uintptr_t)data_to_hash, + data_to_hash_len, &digest_list); } else { ret = tcg2_create_digest((u8 *)(uintptr_t)data_to_hash, data_to_hash_len, &digest_list);