Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp13565670rwl; Wed, 4 Jan 2023 09:50:37 -0800 (PST) X-Google-Smtp-Source: AMrXdXsf4w5js1tJFaXuVvQfKl078h824qY1Ju0frn8kWabYfzo+ciD3PQZ1enoo3HbGW6c3Gfls X-Received: by 2002:a17:907:8c08:b0:7c1:65d1:c4ca with SMTP id ta8-20020a1709078c0800b007c165d1c4camr23382583ejc.33.1672854637422; Wed, 04 Jan 2023 09:50:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672854637; cv=none; d=google.com; s=arc-20160816; b=fxJYf+6LzCyjlTHKawNY4DVuTDcdCtLZA4+/meU81kV/7TxM+BX0JfzIHcU0dyL8EA 5W1QX3v51lt3psAcErDkS2s9kpbJ+Se+2ijCBUEMsxQBNsHQqIeCChxJ3S2sBc6bVL4A fR+5hJbXrs7JWiJaUPlE3T6cfcy7zFR/PftSKf8sjaJvspFX9s8e7JPOmjt3FZZiwhcu aBEXwYKO6vU1mMubErl7+QqTipdnX+5U0VrdEyi2yH0QQrCvgniBeV64CdUCQqO5HsKX t9o7eS/gT+czblzc5VzTWGMTH7E0atjW3zp/M3kSm17Zs4x2mKzoDkrc9IwURmNl2rdo Eptw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Bq5T3H7ajPyPQ9vioDE0tfMvtiYQIDdq9hBdspYl9j0=; b=Spu709DUQO7D0jnEyLuV8a9nyPAPn9VEeIvSFPJYXBFO9qHBsJc5Wv3F8EI9BEXfDI Zp4mwlQUG6rFLC3kYj3+k9tICvk51IEjStZsHYMe2UHv4WXHuvjgM7ZsRTzqad0wlaug 9vGH3DLl3eCdKOiehPBwnLEIEsXt89SUkRPq09mtZjAJ2fLB9fSwSEAsarkOA7fMAonp QddxCyszsSG3yFhFt19acCK88SV0KrYmuCyDGO8je7Unw8UhbMisJGRP3YZzTcw3ni/i JKIwcGWRWQLVa18qy47JGDXIuq+X9GiVjnu8yK8evRHJQ+m1eZLAuPr3TvbNxRB6ZQGy maHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20210112 header.b=CsPmMx+Q; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sa1-20020a1709076d0100b007c11e5ad98csi31418422ejc.352.2023.01.04.09.50.19; Wed, 04 Jan 2023 09:50:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20210112 header.b=CsPmMx+Q; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239843AbjADRtX (ORCPT + 67 others); Wed, 4 Jan 2023 12:49:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239803AbjADRtO (ORCPT ); Wed, 4 Jan 2023 12:49:14 -0500 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22B35FD08; Wed, 4 Jan 2023 09:49:14 -0800 (PST) Received: by mail-ej1-x632.google.com with SMTP id qk9so84271669ejc.3; Wed, 04 Jan 2023 09:49:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Bq5T3H7ajPyPQ9vioDE0tfMvtiYQIDdq9hBdspYl9j0=; b=CsPmMx+Q8xRhbNWd8KXeVRAKH0EU5k3rTIdnWRqva1tIJPxI1RBQGAz6rUO4ieDl2j D/equzfgg+UmrQVjuz1hEl3E03Xc7L6ITI2RtG0vwVboO9oSbcuKtaAVP3cZyqlkCHJ1 2x97dl5O9lwKK3bUIysfz4OJDOn4OTobQd+bvFagZB/BRKhcEoiBRJ5+9ZAXz6B9FHMw 289gs0mdZB40AKhClGPTmmG3aSE0MLyuo1nHqSNO/wY5estDyMW0AoB60nKMLfgM6KnJ FYI857FWXYCkbICNc4XI0j4agRAAVsiae7BuiQYtCFmlbELjHsNmGY2D3gNf8FCERPav wZhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Bq5T3H7ajPyPQ9vioDE0tfMvtiYQIDdq9hBdspYl9j0=; b=j9xj2Kq+zDyAndNUdgboRb1Erlr0/X4Xi59//tco6pFv98mvYiiUgV06Jl09p+DNmB w8HoWTV4xOqiaEgVHb0za7znP9tZmk+a+GyGxxl5SK2HQT8rAKlZVwWFsgkw4dzC7Ji2 vR1oDZD46rj162yvrvTg4X0pKFmVRYX67tM3txfKReQBA4z/OxdCCZANSxzbEIGSYql9 T95GgIYHepZ5lL3GcAZ9F1LGgG6fZqlhpBlEwE9/eUqlwXVCJCpDSIz6+ugbnJWlWvNX PS4Y9fL7Xf9JS3J5Uz/FyDvWpeg9FUKDZf84RG/GRd3w4GQfJ33qysOZZK+GoPAXpAvc i6vA== X-Gm-Message-State: AFqh2kqro2ehjjZDh8Y+kiczGTXHEKBcQwmS8RXb1UxPyEQkJV4P4/FG 890D7N/Q4vwJYs6ACehYaKocanIViucpvrxEo/A= X-Received: by 2002:a17:907:7e9b:b0:7ad:a2e9:a48c with SMTP id qb27-20020a1709077e9b00b007ada2e9a48cmr3541600ejc.77.1672854552640; Wed, 04 Jan 2023 09:49:12 -0800 (PST) MIME-Version: 1.0 References: <20221228133547.633797-1-martin.blumenstingl@googlemail.com> <20221228133547.633797-2-martin.blumenstingl@googlemail.com> <92eb7dfa8b7d447e966a2751e174b642@realtek.com> <87da8c82dec749dc826b5a1b4c4238aa@AcuMS.aculab.com> <5c0c77240e7ddfdffbd771ee7e50d36ef3af9c84.camel@realtek.com> <662e2f820e7a478096dd6e09725c093a@AcuMS.aculab.com> In-Reply-To: <662e2f820e7a478096dd6e09725c093a@AcuMS.aculab.com> From: Martin Blumenstingl Date: Wed, 4 Jan 2023 18:49:01 +0100 Message-ID: Subject: Re: [PATCH 1/4] rtw88: Add packed attribute to the eFuse structs To: David Laight Cc: Ping-Ke Shih , "linux-wireless@vger.kernel.org" , "kvalo@kernel.org" , "tehuang@realtek.com" , "s.hauer@pengutronix.de" , "tony0620emma@gmail.com" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: multipart/mixed; boundary="0000000000005f1bc105f173cdb2" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org --0000000000005f1bc105f173cdb2 Content-Type: text/plain; charset="UTF-8" On Wed, Jan 4, 2023 at 5:31 PM David Laight wrote: [...] > > > What you may want to do is add compile-time asserts for the > > > sizes of the structures. > > Do I get you right that something like: > > BUILD_BUG_ON(sizeof(rtw8821c_efuse) != 256); > > is what you have in mind? > > That looks like the one... I tried this (see the attached patch - it's just meant to show what I did, it's not meant to be applied upstream). With the attached patch but no other patches this makes the rtw88 driver compile fine on 6.2-rc2. Adding __packed to struct rtw8723d_efuse changes the size of that struct for me (I'm compiling for AArch64 / ARM64). With the packed attribute it has 267 bytes, without 268 bytes. Do you have any ideas as to why that is? Best regards, Martin --0000000000005f1bc105f173cdb2 Content-Type: text/x-patch; charset="US-ASCII"; name="add-build-bug-on.patch" Content-Disposition: attachment; filename="add-build-bug-on.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lchy60110 ZGlmZiAtLWdpdCBhL2RyaXZlcnMvbmV0L3dpcmVsZXNzL3JlYWx0ZWsvcnR3ODgvcnR3ODcyM2Qu YyBiL2RyaXZlcnMvbmV0L3dpcmVsZXNzL3JlYWx0ZWsvcnR3ODgvcnR3ODcyM2QuYwppbmRleCAy ZDJmNzY4YmFlMmUuLjQ3MzkyZDcyMmY4ZCAxMDA2NDQKLS0tIGEvZHJpdmVycy9uZXQvd2lyZWxl c3MvcmVhbHRlay9ydHc4OC9ydHc4NzIzZC5jCisrKyBiL2RyaXZlcnMvbmV0L3dpcmVsZXNzL3Jl YWx0ZWsvcnR3ODgvcnR3ODcyM2QuYwpAQCAtMjIyLDYgKzIyMiw4IEBAIHN0YXRpYyBpbnQgcnR3 ODcyM2RfcmVhZF9lZnVzZShzdHJ1Y3QgcnR3X2RldiAqcnR3ZGV2LCB1OCAqbG9nX21hcCkKIAlz dHJ1Y3QgcnR3ODcyM2RfZWZ1c2UgKm1hcDsKIAlpbnQgaTsKIAorCUJVSUxEX0JVR19PTihzaXpl b2YoKm1hcCkgIT0gMjY4KTsKKwogCW1hcCA9IChzdHJ1Y3QgcnR3ODcyM2RfZWZ1c2UgKilsb2df bWFwOwogCiAJZWZ1c2UtPnJmZV9vcHRpb24gPSAwOwpkaWZmIC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