From patchwork Thu Apr 6 19:37:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 670764 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp1026971wrt; Thu, 6 Apr 2023 12:37:35 -0700 (PDT) X-Google-Smtp-Source: AKy350YBlKy1K+78L1RB5YaTHM97Ioi9POuu5WB99WtRUqYzuDexhi9eJS2ps0dW+stHQB+gkkH8 X-Received: by 2002:a5d:94c1:0:b0:715:3123:9514 with SMTP id y1-20020a5d94c1000000b0071531239514mr539221ior.3.1680809855244; Thu, 06 Apr 2023 12:37:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680809855; cv=none; d=google.com; s=arc-20160816; b=nfZ86SMCKxHIME2nxdVYwN9hR+QAhGM1MygCr/IL1jfdxJYP7803ix5Rj9DYt5POpl epPNJe01FIgETeOu1QJtDiN3k8DOxZGkApd5M88qBrH1f5Q4Wsd9pyuX6oZjH0uoO9gW zobugmWFewXCisKcVdL+o86ukDF7QW3NfpgGKcSaoCStqeONiJMvy+zu6Mg9qq4AIseu oC1h/3TxZTe+ZD0RkSdNlYPsUqW+zILt57iiZEXD8LBZFjABoGtrENsJULKAvyznOdk9 5fGtxFaPi9pyYL7W4271rs8jorBkQe9DQ13AsxmRhvW4ocboFVvPYckKJczYnJEnEhW+ selw== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6zLLqIVHL9n0dgpcS2OBaWamq+gdVgDV2pC6Y/6Kryg=; b=wfA5fwcPZ36DpzOYr7b3WoH/GYNkMXg5rFK59vToDxiJq7UBnwilDP4MZfpZJg0Eqw M0G8G+LzUa7ep70yaqVCSvrYpQaQPzhvzAWlTXxdtL38RqLlJu0k9+PuJrPc53Q5gZOt Aw1Ay5wFISb7Pruv3Kq5MZpwrDB1yBeLswpPlFkqmAV/LyvJm/EKEg7/1mAxf7tnCGKx mWwwtHoleB8ulLwO72uFWaniQN0Eu2nr+hOuptxGlWiZKDXrfBXGloTa69Uvzlo58KCD xrVepTMbl9o6dzAaBKtorWAGsCJGDXkOh+ELk+3LQI47nentQACMYcDT1QFmM9oZBqqo Dwuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xBGci2ZT; 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 b2-20020a5ea702000000b007594f3ae468si1544702iod.120.2023.04.06.12.37.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Apr 2023 12:37:35 -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=xBGci2ZT; 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 5BCDF86065; Thu, 6 Apr 2023 21:37:22 +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="xBGci2ZT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8FFAB860A0; Thu, 6 Apr 2023 21:37:17 +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.1 required=5.0 tests=BAYES_00,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 mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) (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 68F53860C2 for ; Thu, 6 Apr 2023 21:37:13 +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-ej1-x62b.google.com with SMTP id g18so3943550ejj.5 for ; Thu, 06 Apr 2023 12:37:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680809833; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6zLLqIVHL9n0dgpcS2OBaWamq+gdVgDV2pC6Y/6Kryg=; b=xBGci2ZT/Fi5uL1JszgfEs+Y3Qm9l80jmS3hdmJhap8oRZQNqi6bPSRxg79yhmgUgr i00Xu/TFxErtgWo1BBUMq1yHMpadEBoQ0lKA1vGjz6F2FZLTjDior8nReWWn/LfL3Wb/ P+cVly1op3EqYH/QsCqyLFjQKO8DeiZt7pgWEOSeWeFtRpQD0456UvHmR/YvAI4CD8R3 HUHLi7xI01nzntQGqLKztZat6928diuocIjzcQlTRpbHvJEh9TU7minaKzPOAoqD+gzA p6rr5xs/HWARjKt9pFvlN+P9AKbpM+TOCiYn/wlWvYcI1VJFbiT4THQjsnjL+J7Vdr6/ UrrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680809833; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6zLLqIVHL9n0dgpcS2OBaWamq+gdVgDV2pC6Y/6Kryg=; b=kXBP/uTfT5GDFkQ+YxQdrIWbxIJCJTVhSLTIhTpPxVyMrVJ+0y0tRgHUMwwFZxMCb6 SqmaV7Nn8VqvDA/zZRYCOWnGF9b4BFYXcOPXf05L6DAgJ/CS8aVVlxdNE8MSK7uXiIXA Z5TZ5lZjZGHDQiXK2Pity0Q/7TBq6GuWQMxgscu14O36MytsQcZOnfDF6UZqliyFHCNs YLbG91tJhCwReAybMTdxbW+Vq2OTM4rtwutwLnX4PAlmPRVLus7xU1kXh+E0LisvGkGw SZKqbTbnFMnnsT9v/agrPFdefGgn6LFSZ1BMo5SmdWBNUOgaH+BDI8IFe4KsRx+KoP/L X7FA== X-Gm-Message-State: AAQBX9dCg1Ia8VrxGkGAVo1MirPAE36xq0/cokhVHDTooUDOcjuDcw04 hrAqWMVeT49BRFnYVCcZCWxB8i42tCeyAGJuJyw= X-Received: by 2002:a17:906:fe05:b0:947:d875:68f9 with SMTP id wy5-20020a170906fe0500b00947d87568f9mr7240448ejb.0.1680809832952; Thu, 06 Apr 2023 12:37:12 -0700 (PDT) Received: from localhost.localdomain (ppp176092130041.access.hol.gr. [176.92.130.41]) by smtp.gmail.com with ESMTPSA id k2-20020a1709060ca200b009373f1b5c4esm1164078ejh.161.2023.04.06.12.37.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Apr 2023 12:37:12 -0700 (PDT) From: Ilias Apalodimas To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Tom Rini , Heinrich Schuchardt , Heinrich Schuchardt Subject: [PATCH 2/2] efi_loader: Fix warnings on unaligned accesses Date: Thu, 6 Apr 2023 22:37:07 +0300 Message-Id: <20230406193707.2238981-2-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230406193707.2238981-1-ilias.apalodimas@linaro.org> References: <20230406193707.2238981-1-ilias.apalodimas@linaro.org> 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.8 at phobos.denx.de X-Virus-Status: Clean Tom reports that when building with clang we see this warning: field guid within 'struct efi_hii_keyboard_layout' is less aligned than 'efi_guid_t' and is usually due to 'struct efi_hii_keyboard_layout' being packed, which can lead to unaligned accesses [-Wunaligned-access] This happens because 'struct efi_hii_keyboard_layout' is defined as packed while efi_guid_t is 32bit aligned. However the EFI spec describes the EFI_GUID as "128-bit buffer containing a unique identifier value. Unless otherwise specified aligned on a 64-bit boundary" So convert the efi_guid_t -> u8 b[16] here and skip the alignment requirements. Reported-by: Tom Rini Suggested-by: Heinrich Schuchardt Signed-off-by: Ilias Apalodimas --- include/efi_api.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/efi_api.h b/include/efi_api.h index 2fd0221c1c77..b84b577bd7b5 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -1170,7 +1170,7 @@ struct efi_key_descriptor { struct efi_hii_keyboard_layout { u16 layout_length; - efi_guid_t guid; + u8 guid[16]; u32 layout_descriptor_string_offset; u8 descriptor_count; /* struct efi_key_descriptor descriptors[]; follows here */