From patchwork Mon Mar 29 13:59:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 410858 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3647586jai; Mon, 29 Mar 2021 07:00:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNY0rPW0psPfOei489glD5KTwkvAPVc08/oUN+U74P141w0Rc804zLw8A0gpirvL/RRf/v X-Received: by 2002:a17:906:814b:: with SMTP id z11mr28534550ejw.290.1617026415451; Mon, 29 Mar 2021 07:00:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617026415; cv=none; d=google.com; s=arc-20160816; b=UahoTTQUUKeGxCbaO8oiJgmngEVaeAZVaVaM3ay4cOSCFHmXgjkRUwO1kOuw7DNpiQ 3T7d/viRUGtm3b9Uphzl2/tSUUHqeNN+1vqWV99t0ZSaWkMY5Y7qukNyEuOHGs1Rwqsm Ol9MNwUj0Ot2QxY5fO8XEPnmK/G22Mo8FKoohby6OBbLGQn/OH7/d1MyN0GjpkWGG6tE wrXRyBE2Q3ngTEHWwWXnhxrK+/IDcQjcACGAnXCS3Bo3zGPipV+BI5tqkf4awBTNVgnL kUkridx0k74S9Z+F0TA52REfxjN0lwJ5YlmsnrPmt1jjw+90V+DjJiyw7UDaXwwQRDxd FD0g== 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:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=EwR//izfYSwuXChvgHdXCnl4v0hU5MurlfUJAxrNoYI=; b=fCUPe373aO0LavTtt9apEHj5NdAkUgCGJhEFkqi/iBhogInvv0OTCKAkyRI2TYnaHP FltktRVe68cE86B3jbLOC5k1abF9J/VlohVisRuewxEYGSu6pX2b7vw5teXKOwMhfYxs hYYGjKxkuEWr8ZPvGek8QoLTvjB8A5rbhCNSHkAWdffshazU0q/zaUvjeyykyPx3998D xFuVQ7kAHxmu3plCWjVQFOqIApNuxjPbKKcbrLeCcpnGu7IXPV+UI2Dt0hCuDLvObPFz D5T19mUYoTpLY693wZgeJuTjXw8qekZka/mAX0RuVBtxoa9p82LHOKqdAGEbdnotaKPW CY/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ac6LsSgI; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id f12si13152503ejc.552.2021.03.29.07.00.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Mar 2021 07:00:15 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ac6LsSgI; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 8D32D828B3; Mon, 29 Mar 2021 16:00:05 +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="Ac6LsSgI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 50C12828B9; Mon, 29 Mar 2021 16:00:01 +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-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) (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 7BE3F828A4 for ; Mon, 29 Mar 2021 15:59:58 +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=ilias.apalodimas@linaro.org Received: by mail-wm1-x32a.google.com with SMTP id b2-20020a7bc2420000b029010be1081172so6734433wmj.1 for ; Mon, 29 Mar 2021 06:59:58 -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:mime-version :content-transfer-encoding; bh=EwR//izfYSwuXChvgHdXCnl4v0hU5MurlfUJAxrNoYI=; b=Ac6LsSgI5+Dg0K0u9f3hAQhXB6qVBpZcHmiZHwKt5wHbLSuaSReYjKyg/7iqJiaFTB nZGJ00cDlYGcGDLOqkSlLUuUE+T2320Vlwf+gONRtw9KXuHFEq1FOxcBkdVRnlzseREE wKZgjmNsWXRP8stcRS9zau451Zsm76tHV9GMyn2OwOzugOXYAnoom0GEmCJdE2M/TmOp u11Sz0Xe+N6pa5c8aGh5YwoLJOO+pqZTydpYkM3E0D9PhZtRnh57nia/kppo8wAu1ibY ZgigBoeeRIZynsZLhFIhvGO2GE84Yl4Cs2rOFQvyGcq3uNfsSUphBg0rfQzfEIcimySP k12w== 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:mime-version :content-transfer-encoding; bh=EwR//izfYSwuXChvgHdXCnl4v0hU5MurlfUJAxrNoYI=; b=C6pkQsAsXmQsf3PKu1NI++rEFw/H00XL1/oKmvt/az28Z6pUHDoIIcoxaHC9twgidQ uSIXp6osUbVqQ4YruPGFG4EqMDQ+jWLeKoziZL82oj3r4hrjtCR3MNPL2T45n7Dle4yk pXy5pI/KoJ/RlFvU7alGUjeS3DLkSIPYmNsnodyXROJahB9S3EIbwOqrqNfOyRZFyZLJ UvgjcTHr085TQrbXDxWWf/aJ4hSlca4X/LxVKO2hr4NRpCRcH1NJCT9PYHafsi4jiJUn X3JhYTwJSowTQzoVVTwMi/DiyNRNcrSZJEP493Sfo4H6v7ir2ZRmwgXwC4TS3ciyoW55 sGqg== X-Gm-Message-State: AOAM531Js7bR2tsvlRKPUlxRlMRVtx7kIDsGzvbTsUqjdFPMc5q/rsT/ HHylM48/fqxMGUzJPJAJwMq9dw== X-Received: by 2002:a7b:c3c1:: with SMTP id t1mr24921515wmj.47.1617026397838; Mon, 29 Mar 2021 06:59:57 -0700 (PDT) Received: from apalos.home ([2a02:587:464a:c916:2e56:dcff:fe9a:8f06]) by smtp.gmail.com with ESMTPSA id l21sm24955308wmg.41.2021.03.29.06.59.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Mar 2021 06:59:57 -0700 (PDT) From: Ilias Apalodimas To: xypron.glpk@gmx.de Cc: Ilias Apalodimas , Alexander Graf , u-boot@lists.denx.de Subject: [PATCH] efi_loader: convert void* to u8* on the tcg eventlog buffer Date: Mon, 29 Mar 2021 16:59:55 +0300 Message-Id: <20210329135955.5804-1-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.31.0 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.4 at phobos.denx.de X-Virus-Status: Clean Although ptr arithmetics are allowed with extensions in gcc, they are not allowed by the C spec. So switch the 'void *' containing our eventlog buffer into 'u8 *' Signed-off-by: Ilias Apalodimas --- lib/efi_loader/efi_tcg2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.31.0 diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c index 09046844c723..d5213586cb9c 100644 --- a/lib/efi_loader/efi_tcg2.c +++ b/lib/efi_loader/efi_tcg2.c @@ -23,8 +23,8 @@ #include struct event_log_buffer { - void *buffer; - void *final_buffer; + u8 *buffer; + u8 *final_buffer; size_t pos; /* eventlog position */ size_t final_pos; /* final events config table position */ size_t last_event_size; @@ -990,12 +990,12 @@ static efi_status_t create_final_event(void) * EFI_CONFIGURATION_TABLE */ ret = efi_allocate_pool(EFI_ACPI_MEMORY_NVS, TPM2_EVENT_LOG_SIZE, - &event_log.final_buffer); + (void **)&event_log.final_buffer); if (ret != EFI_SUCCESS) goto out; memset(event_log.final_buffer, 0xff, TPM2_EVENT_LOG_SIZE); - final_event = event_log.final_buffer; + final_event = (struct efi_tcg2_final_events_table *)event_log.final_buffer; final_event->number_of_events = 0; final_event->version = EFI_TCG2_FINAL_EVENTS_TABLE_VERSION; event_log.final_pos = sizeof(*final_event);