From patchwork Fri Jun 16 09:03:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 693594 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75FB6EB64D7 for ; Fri, 16 Jun 2023 09:06:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343939AbjFPJGU (ORCPT ); Fri, 16 Jun 2023 05:06:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343928AbjFPJGF (ORCPT ); Fri, 16 Jun 2023 05:06:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D71521BE3; Fri, 16 Jun 2023 02:03:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6E66260C5E; Fri, 16 Jun 2023 09:03:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C6C5C433C0; Fri, 16 Jun 2023 09:03:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686906228; bh=bhE+0A/OQIrRGA/14kkswPkAR/ndWpXFLbO2JGK/4v4=; h=From:To:Cc:Subject:Date:From; b=p/288pR+J8bm9d+aQU3rQISNwuWPc6m1kc94uuz63DfMzJEmOh+SjrWc80HC+m8FN VCRXCaB8VCpDeVOi6P9XFKaiNAcUEDug6NYRmDPHr/drHzNri9ogRAAOFRVwkbylac CG6P61TvyPw039Qb4j1beTWgM+c4f2ni4W+Fw7BDP3Ar/jqcElLF88kWM7ewyKc85E fQeM1WlCJhtjcyFkLB1XklJIjJKtn8EkvkzT/iNQaDE0BrdjRhVc2uac1X7+q4MbRw QJpWVC9sSCz/cqbP8Z5sDFuqkpzTGpQzwlyrI7P4QqAgStRtMEEup1N4ysSzHjyS12 yS7W58uSSno7A== From: Arnd Bergmann To: Gregory Greenman , Kalle Valo , Luca Coelho , Shahar S Matityahu Cc: Arnd Bergmann , Mukesh Sisodiya , Johannes Berg , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] iwlwifi: dbg_ini: fix structure packing Date: Fri, 16 Jun 2023 11:03:34 +0200 Message-Id: <20230616090343.2454061-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Arnd Bergmann The iwl_fw_ini_error_dump_range structure has conflicting alignment requirements for the inner union and the outer struct: In file included from drivers/net/wireless/intel/iwlwifi/fw/dbg.c:9: drivers/net/wireless/intel/iwlwifi/fw/error-dump.h:312:2: error: field within 'struct iwl_fw_ini_error_dump_range' is less aligned than 'union iwl_fw_ini_error_dump_range::(anonymous at drivers/net/wireless/intel/iwlwifi/fw/error-dump.h:312:2)' and is usually due to 'struct iwl_fw_ini_error_dump_range' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access] union { As the original intention was apparently to make the entire structure unaligned, mark the innermost members the same way so the union becomes packed as well. Fixes: 973193554cae6 ("iwlwifi: dbg_ini: dump headers cleanup") Signed-off-by: Arnd Bergmann Acked-by: Gregory Greenman --- drivers/net/wireless/intel/iwlwifi/fw/error-dump.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/error-dump.h b/drivers/net/wireless/intel/iwlwifi/fw/error-dump.h index f5e08988dc7bf..06d6f7f664308 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/error-dump.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/error-dump.h @@ -310,9 +310,9 @@ struct iwl_fw_ini_fifo_hdr { struct iwl_fw_ini_error_dump_range { __le32 range_data_size; union { - __le32 internal_base_addr; - __le64 dram_base_addr; - __le32 page_num; + __le32 internal_base_addr __packed; + __le64 dram_base_addr __packed; + __le32 page_num __packed; struct iwl_fw_ini_fifo_hdr fifo_hdr; struct iwl_cmd_header fw_pkt_hdr; };