Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp977508pxb; Fri, 1 Oct 2021 00:04:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5E1y7vVxFxXgKG6yb4rcKhbeQduHWBYWhYHY4ZiZyK9qVthoJ+OeBAIPR5cGw5hjL1lSD X-Received: by 2002:a17:906:848f:: with SMTP id m15mr4381782ejx.11.1633071854554; Fri, 01 Oct 2021 00:04:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633071854; cv=none; d=google.com; s=arc-20160816; b=d0T/YhqkJ8ANfNlkMjtpNcSn7n9Iqe93xIIkZXPM4Toim9rd6VXSSpiTyzmeD5Cyx3 k9UYphWUM1s/H+vFA7KveZZielqc4VChHEW4ZKYa5xP/9e5e4bwFsMfm1uA5RRAsNAYX wcTlhKcTRPAxqCm0vrr/g4J5Avb+rhH0cJ3S9iI8XPKwTkKsCtJjhn36bjkt3hGmUrtI 9zAqveBf7kQRK6ySUZDMTQRDmf9ylwcTmzZigByXHJsUJ/5C0aJ8eV4vVOgn2pZiaK8f l0ACcOdvpuA7+RR98d81kLrmiJc38X1JMQzAI9+5b9R8WInSB4bwKKSbgTuUQXpXhDdo LBqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=NJr5xpW7MZSkW7xFINyqHqDBDFCpW/nUdFRJKEADvuc=; b=axDRvelvFXxJf4n1WHkP2aR/nsPZiAg3XVqy40oBDRUis1jxmv19el7tBUS4bhqZq5 j668a3h1EsY7Et4z4Dk6DNFIvm1l4psePxzT7P1ilq4OUiI5JBcIcr75BPjsD7ztBGbq YrCSs5xKl1L27fWco/HM19YkxaQ9uDPub9JVKbNqBdTnyyExw6qpYeQ/Y6mhWgPlc/t1 UAjCHMGmKHyWNBlfE8X9UdSp8JyM3tG0r8cxvzNll+NxfP5BZd0swzDyzwaIfnzm0KQv ApDjpyJRT6iD6scw6PzJ1hP7yTTJEMPGmLC/3uSQmr66RZX5I26ZVdp0fTNrQv/bZMFF KjXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=Uu7zYnJ3; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w14si8152958edd.343.2021.10.01.00.03.50; Fri, 01 Oct 2021 00:04:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=Uu7zYnJ3; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352032AbhJAHDf (ORCPT + 78 others); Fri, 1 Oct 2021 03:03:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352394AbhJAHCz (ORCPT ); Fri, 1 Oct 2021 03:02:55 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDC48C061776 for ; Fri, 1 Oct 2021 00:01:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=NJr5xpW7MZSkW7xFINyqHqDBDFCpW/nUdFRJKEADvuc=; t=1633071670; x=1634281270; b=Uu7zYnJ3z2nsj7CKAa237RvdF5bQ9CAvT5bABwkita1J23X mQiRAXKoaZUOYRaIHDrDJZCG3Ticq56j+y4IPTYWw2IGUabZ1K4EYdKybV8RelHYjn6LcC7yFsooC OuGopY+DoDc03dbfm9JRIBNEHfyIjmRYe25h1pMatNsX1JxWWNDhyNti8A8hXjeSZjvm6bjtIcpGQ d7hMzreIKv+pgld/sgfV0B0lJ09C2u9pKRd3NJdigLWKW7mkpyb5auQaXXuLJ7Q0On6qjnFA5a+c6 GOdE4N3b+AxVI0OPY9Mrh/RBt6A/F4MHlQIJgL/wXD8sunS/aQ/Hv9+/RqnnPi/g==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.95-RC2) (envelope-from ) id 1mWCXX-00E6g7-PG; Fri, 01 Oct 2021 09:01:03 +0200 Message-ID: <93c99a81d89aafed21e8e22157b3bf21526be716.camel@sipsolutions.net> Subject: Re: [PATCH v3 2/2] mac80211: do intersection with he mcs and nss set of peer and own From: Johannes Berg To: Kalle Valo , Wen Gong Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org Date: Fri, 01 Oct 2021 09:01:02 +0200 In-Reply-To: <87bl49mf02.fsf@codeaurora.org> References: <1609816120-9411-1-git-send-email-wgong@codeaurora.org> <1609816120-9411-3-git-send-email-wgong@codeaurora.org> <87bl49mf02.fsf@codeaurora.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-malware-bazaar: not-scanned Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Fri, 2021-10-01 at 09:32 +0300, Kalle Valo wrote: > > > > Add "__packed" before the "__le16 *" should solve this warning by my > > understand like this: [snip] > > > > -static void ieee80211_he_mcs_disable(__le16 *he_mcs) > > +static void ieee80211_he_mcs_disable(__packed __le16 *he_mcs) > > [snip] > I don't know what Johannes thinks, but to me that looks like an ugly > hack. Wouldn't use get_unaligned() or similar be cleaner? > Well, then we've have to pass an untyped pointer (void *), which I guess is fine? Since we do all kinds of le16_to_cpu() with it anyway, that'd just become get_unaligned_le16(). That's probably the better choice. But regardless, would the __packed even *work*? __attribute__((packed)) is documented as: This attribute, attached to a struct, union, or C++ class type definition, specifies that each of its members (other than zero-width bit-fields) is placed to minimize the memory required. This is equivalent to specifying the packed attribute on each of the members. When attached to an enum definition, the packed attribute indicates that the smallest integral type should be used. Specifying the -fshort-enums flag on the command line is equivalent to specifying the packed attribute on all enum definitions. [snip example] You may only specify the packed attribute on the definition of an enum, struct, union, or class, not on a typedef that does not also define the enumerated type, structure, union, or class. So I'm not convinced it would actually *do* anything here at all, in the proposed context? johannes