From patchwork Sun May 1 09:26:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1624873 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: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=kDZZUGHl; dkim-atps=neutral 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=) 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 (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Krgpr33tmz9s5V for ; Sun, 1 May 2022 19:27:00 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3CEB783BBF; Sun, 1 May 2022 11:26:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com 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=canonical.com header.i=@canonical.com header.b="kDZZUGHl"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8B6CC83D07; Sun, 1 May 2022 11:26:45 +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.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from smtp-relay-canonical-0.canonical.com (smtp-relay-canonical-0.canonical.com [185.125.188.120]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4AC4C83B2F for ; Sun, 1 May 2022 11:26:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heinrich.schuchardt@canonical.com Received: from LT2ubnt.fritz.box (ip-062-143-094-109.um16.pools.vodafone-ip.de [62.143.94.109]) (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 smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id CF45E3F62C; Sun, 1 May 2022 09:26:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1651397202; bh=pbXiOTCNqSuRTejhWrS9D0Z92nTHZo3gQt/MKoLzdvU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=kDZZUGHlGRbHsURwJb2b1U+O+3+gR2JIWgP4GIm0wrFrobrH9h0jAIwcPIDXCn0G5 /0GSU51ILUAvuhjCeQpXidLcAgzQkl6XRgRrWgPw/bFiuwt7dII+/mSqqkMQtzXokk Ngjk789N+73DTrCLB24VSFMQ0I4ScLWlhTNNZE3iN947QBGdbndA4QfxM+490J6bHq ODTRnbTJuaiE6kYp7nBr2SFpM3lF4pC8fD9wP5XtDZDEfNyw7EpZqDj0RWlpbuwIjJ WmCUMaOp0i/URj+cEUMJaEWtaz2YxQwJG7pmts1D6H2/bNv2SdXe0bJ7oFUKZPMrpd aGSFzm7h9OXXA== From: Heinrich Schuchardt To: u-boot@lists.denx.de Cc: Heinrich Schuchardt Subject: [PATCH 1/1] efi_selftest: clean up unaligned unit test Date: Sun, 1 May 2022 11:26:40 +0200 Message-Id: <20220501092640.37315-1-heinrich.schuchardt@canonical.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.5 at phobos.denx.de X-Virus-Status: Clean * fix typo %s/give/given/ * don't use void * in pointer arithmetic Signed-off-by: Heinrich Schuchardt --- lib/efi_selftest/efi_selftest_unaligned.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/efi_selftest/efi_selftest_unaligned.c b/lib/efi_selftest/efi_selftest_unaligned.c index 6fce110b76..7c6bf2d6e8 100644 --- a/lib/efi_selftest/efi_selftest_unaligned.c +++ b/lib/efi_selftest/efi_selftest_unaligned.c @@ -14,14 +14,14 @@ struct aligned_buffer { }; /* - * Return an u32 at a give address. + * Return an u32 at a given address. * If the address is not four byte aligned, an unaligned memory access * occurs. * * @addr: address to read * Return: value at the address */ -static inline u32 deref(u32 *addr) +static inline u32 deref(void *addr) { int ret; @@ -43,12 +43,11 @@ static int execute(void) { struct aligned_buffer buf = { {0, 1, 2, 3, 4, 5, 6, 7}, - }; - void *v = &buf; + }; u32 r = 0; /* Read an unaligned address */ - r = deref(v + 1); + r = deref(&buf.a[1]); /* UEFI only supports low endian systems */ if (r != 0x04030201) {