From patchwork Thu Apr 6 19:37:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 670763 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp1026905wrt; Thu, 6 Apr 2023 12:37:22 -0700 (PDT) X-Google-Smtp-Source: AKy350Z9G1V48M6UKbaJavXe7ZZMgz9xho6glKVbU3cDNc6tdMfM8bFrz2Mwh1p8Ljkkfhcf6haP X-Received: by 2002:a6b:ee01:0:b0:74c:8b56:42bb with SMTP id i1-20020a6bee01000000b0074c8b5642bbmr4788215ioh.8.1680809841816; Thu, 06 Apr 2023 12:37:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680809841; cv=none; d=google.com; s=arc-20160816; b=z58IPYPZ6oMs3MjfGJ9FxCWDLfe0hhhTSVxV2Ic5ixzemwqsdkl+mG8u1jGeP4PRYA CeQFzxmhIaGWQdFXJkObdX9fdPE8DIavPU0D7yFYo9gqC1KcxeYZGdVk6deZluOLJUUR VA6WcnFOi4Kl1fB6p0TKlX4M9RU3AExK5MzmRIns2chx1iVYN9wQrt793uS4b4oc0C2M BZ1AYc07lTdvUXaIkBZDyfPZi7TtUetovV/3gbdVhmcwSvQNYKBRYsWHiSVkAbWwHNKP 1UzwfA2UpnUmsY2x7LWQ1BQXJExrcRvvJgy9Iafi6g/d3tGimITd5X+GnzUtaF+tB+Hd PbqQ== 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=orG6+czDNy5k3DxoyGDd2A2/EEmsmI3OJ6eVnBo7L+c=; b=SyC4DzVBvvsR7rbzPLMdeWvelagNfJNI+qsoj3TiVJ5l5kbMx/hA+5TBXHpvEqOKGJ jORzurzkakLl17Bbjdu0h1H0WA9INdjcXDDJre7IYVJMIp8gck5joK0SCbQw4UGCOblZ pHxbi//H6vO0bMOoH6F0elLSPJAMkcm3go7U9185ZOR+NaYVZYeUXTkv3XiIPlahKYE+ IXEznus2wCqzrSOxHDEGASxglxH/j7jRjLy72CoknmetVjoPlxHYr4NlCzPH1Ua/wgHh dIfcSi7RqTn0uN8K8g5vLz7s69jVHI31/3eQ9xDQDjOmfuW/pjeZLe/+2xRXmaQpf9dA x9jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HuWLQd7E; 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 c4-20020a5ea804000000b007594f3ae46esi1479344ioa.126.2023.04.06.12.37.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Apr 2023 12:37:21 -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=HuWLQd7E; 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 1E7DB860C2; Thu, 6 Apr 2023 21:37:18 +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="HuWLQd7E"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 532E086029; Thu, 6 Apr 2023 21:37:15 +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-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) (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 D5D99860A0 for ; Thu, 6 Apr 2023 21:37:11 +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-x62d.google.com with SMTP id lj25so3938173ejb.11 for ; Thu, 06 Apr 2023 12:37:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680809831; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=orG6+czDNy5k3DxoyGDd2A2/EEmsmI3OJ6eVnBo7L+c=; b=HuWLQd7E6Quh6qos7Np0FE6rrDpaOEg3sLpjIP4z210701VeU1a5gd9jcAPhSfzrz1 fljLEwqL8OZyWCxRG8asZsQ5bJP2fNlReYwtyU/JX4ys/tTHzBq6UdbU3vO83fjkKz7Y /G0y63t/Akz1EMnuSMvtnMdsisscO0nj1L7EBvEm4hgd/x3T5ESd7zcqAHQOG9gcKF26 6fUM00cGXR2FqL8U03qdTU49baf7BraAEryo8TglFz+Wa26FwfVftPeS9oc/1EdPf8yJ kk2AybeCVHjN9GYn4AilwxtFYyYYBQWn/0NIJcUgUcQdQ4o7zqkyiKO9nj6y2x4K6M6O pF/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680809831; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=orG6+czDNy5k3DxoyGDd2A2/EEmsmI3OJ6eVnBo7L+c=; b=1ObkTkdMliHiSM+aER2uEKWlrtaK+eE0+Bi15H1rdUvT1ewNRQ2cX7xokke1WFJb9k fq49OFyhSTGR/RNrjCly8HvSMU67sXU2osuk5idAxvvudKi7twFLtmbDhYFlYUIICUem 0DbP//a8lJqCf37mpglHKhlAlUaRlMquDYshon7Kg/kYbC6mbax59mFTMZ6fSDji8FhY bllvY7ehO4iYbv/vgVLQaEpX1nIr/n73Xsdm84KktdtIbc9Stc624Gwu/yYUqAdNawYl FSbVmubMZd/xAUGMOE/70eT24fm0l0Cbkb1c20h9DDcAFn9AQgRkxWLAFbzUaMQSxxkJ WOfA== X-Gm-Message-State: AAQBX9cbhjPZYzX9yUYaT+qsEfaqmpjWYI7LqVaCOkfFsaSloh+SWkM5 zGV/xOvTA6gSrlHjPmyy/UVGNQ00D730TGu3F6I= X-Received: by 2002:a17:906:150a:b0:932:4255:5902 with SMTP id b10-20020a170906150a00b0093242555902mr6925308ejd.76.1680809831268; Thu, 06 Apr 2023 12:37:11 -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.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Apr 2023 12:37:10 -0700 (PDT) From: Ilias Apalodimas To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Heinrich Schuchardt Subject: [PATCH 1/2] efi_loader: Fix flexible array member definitions Date: Thu, 6 Apr 2023 22:37:06 +0300 Message-Id: <20230406193707.2238981-1-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.39.2 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 When a structure contains a flexible array member, it is not supposed to be included in arrays or other structs. Quoting the C spec [0] "Such a structure (and any union containing, possibly recursively, a member that is such a structure) shall not be a member of a structure or an element of an array." IOW efi_hii_keyboard_layout should not include struct efi_key_descriptor descriptors[]; since we use it at the declaration of struct efi_hii_keyboard_package. [0] https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf chapter 6.7.2.1 Signed-off-by: Ilias Apalodimas --- include/efi_api.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.39.2 diff --git a/include/efi_api.h b/include/efi_api.h index dc6e5ce236c9..2fd0221c1c77 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -1173,7 +1173,7 @@ struct efi_hii_keyboard_layout { efi_guid_t guid; u32 layout_descriptor_string_offset; u8 descriptor_count; - struct efi_key_descriptor descriptors[]; + /* struct efi_key_descriptor descriptors[]; follows here */ } __packed; struct efi_hii_keyboard_package {