Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2287856imu; Thu, 24 Jan 2019 10:09:58 -0800 (PST) X-Google-Smtp-Source: ALg8bN5xkP0uutJhM94UpD5h9E7ne7fOm519flGlb7aqrdsqkiR720TLFKIahaipOCu39oj3uatO X-Received: by 2002:a63:ac1a:: with SMTP id v26mr6960402pge.293.1548353398401; Thu, 24 Jan 2019 10:09:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548353398; cv=none; d=google.com; s=arc-20160816; b=f/OF6f39M23SuTddvtHRoZJG4W1BAMjuExq/4TpnhiOG7Qat2JwPqIZtd8oST37Ke2 gzd4ZusBZeU0acuf888QN5rPCkKbz/tKl0mDz9I3451cSgSUbIyuDgTk2Wuajojw9Dh7 sOdzQ4g9affEbZI85FdRwU9V6W29bJ3JEsNQa+N0i7mx9NiP0KEi88iFADZIkhr8th6I w6rd+7miH3f6boKityD5GIfH1InzQvsTrjY4rz6pjQhuAEj8mckPZa7F+0reJLsS2RtR Tn4bGVjybDiCCqmr87j28IU7Ac/9r1qX3ersoUlFngPK3zqE9W1PMTwq3WdWz9Z4bj6r 3sGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=wQ1FP/hYu/oCXu3omY2zVlEXHJ5n1lUSslRurROWYCI=; b=UU0MXPnN0lwCSZa+cPVoNW9JzPWm29vrQ7vCLMmzQLRv9MijCShRE6nf0YKWhuP4ko XbikhvvIa1i/WrJYvMfZuhj6uSooHlqVL+v83yi0EDDJX0nLfldnH9PdAZnik3FpzltP bkxFmhHsHoBb55pLCcRRCOjYluw/dbZBN1dUkMsn/Qx0dr5Pf2HifxSMXWcaWXRhEvzC /iphDsn/dna+cq6fu1vW5y1SdwObXPCXLvD1vNM54Bwu3VorLClRNbUI+i/D7dXXjfUh h95ZPpYOTuLNSmO4qOUy7wrVHHXrYZNRhz8DrSVoupuXINflkV4RqEU5skP5N0+4MEiC M7zQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u69si22767544pfj.219.2019.01.24.10.09.42; Thu, 24 Jan 2019 10:09:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729382AbfAXSIW (ORCPT + 99 others); Thu, 24 Jan 2019 13:08:22 -0500 Received: from s3.sipsolutions.net ([144.76.43.62]:35600 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729354AbfAXSIU (ORCPT ); Thu, 24 Jan 2019 13:08:20 -0500 Received: by sipsolutions.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92-RC4) (envelope-from ) id 1gmjQG-0005KC-2S; Thu, 24 Jan 2019 19:08:16 +0100 Message-ID: <2b8b377a84883db1a45afb42204d8fb5a7d5ccf9.camel@sipsolutions.net> Subject: Re: [PATCH] mac80211: Remove attribute packed from struct 'action' From: Johannes Berg To: Mathieu Malaterre Cc: "David S. Miller" , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Thu, 24 Jan 2019 19:08:14 +0100 In-Reply-To: <20190124180535.20216-1-malat@debian.org> (sfid-20190124_190610_293460_EB105BCB) References: <20190124180535.20216-1-malat@debian.org> (sfid-20190124_190610_293460_EB105BCB) Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-2.fc28) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2019-01-24 at 19:05 +0100, Mathieu Malaterre wrote: > During refactor in commit 9e478066eae4 ("mac80211: fix MU-MIMO > follow-MAC mode") a new struct 'action' was declared with packed > attribute as: > > struct { > struct ieee80211_hdr_3addr hdr; > u8 category; > u8 action_code; > } __packed action; > > But since struct 'ieee80211_hdr_3addr' is declared with an aligned > keyword as: > > struct ieee80211_hdr { > __le16 frame_control; > __le16 duration_id; > u8 addr1[ETH_ALEN]; > u8 addr2[ETH_ALEN]; > u8 addr3[ETH_ALEN]; > __le16 seq_ctrl; > u8 addr4[ETH_ALEN]; > } __packed __aligned(2); > > Solve the ambiguity of placing aligned structure in a packed one by > removing the packed attribute from struct. This seems to be the behavior > of gcc anyway, since the following is still compiling: > > BUILD_BUG_ON(sizeof(action) != IEEE80211_MIN_ACTION_SIZE + 1); I'm not sure this will work on all platforms, didn't something like alpha pad out u8's to u32 when not requiring packing? I guess I'd feel better about using __packed __aligned(2) here as well, which should solve the warning too? johannes