From patchwork Wed Dec 18 08:16:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 3368461 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 743BD9F314 for ; Wed, 18 Dec 2013 08:16:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5577220114 for ; Wed, 18 Dec 2013 08:16:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7CEED2010A for ; Wed, 18 Dec 2013 08:16:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752320Ab3LRIQI (ORCPT ); Wed, 18 Dec 2013 03:16:08 -0500 Received: from smtprelay0212.hostedemail.com ([216.40.44.212]:60691 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751196Ab3LRIQH (ORCPT ); Wed, 18 Dec 2013 03:16:07 -0500 Received: from filter.hostedemail.com (ff-bigip1 [10.5.19.254]) by smtprelay03.hostedemail.com (Postfix) with ESMTP id CA3896BABE; Wed, 18 Dec 2013 08:16:06 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2, 0, 0, , d41d8cd98f00b204, joe@perches.com, :::::::, RULES_HIT:41:355:379:541:973:988:989:1260:1261:1277:1311:1313:1314:1345:1373:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3353:3865:3866:3867:3868:3870:3871:3872:3874:4250:4321:4605:5007:7652:8531:9121:10004:10400:10848:10967:11026:11473:11658:11914:12043:12296:12517:12519:12555:12740, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:fn, MSBL:0, DNSBL:none, Custom_rules:0:0:0 X-HE-Tag: cork92_52521655ecb2f X-Filterd-Recvd-Size: 2854 Received: from [192.168.1.157] (pool-96-251-49-11.lsanca.fios.verizon.net [96.251.49.11]) (Authenticated sender: joe@perches.com) by omf01.hostedemail.com (Postfix) with ESMTPA; Wed, 18 Dec 2013 08:16:05 +0000 (UTC) Message-ID: <1387354564.13593.26.camel@joe-AO722> Subject: ieee80211_i.h: shouldn't struct ps_data.tim be aligned unsigned long? From: Joe Perches To: Jiri Benc , Johannes Berg Cc: linux-wireless , netdev Date: Wed, 18 Dec 2013 00:16:04 -0800 X-Mailer: Evolution 3.8.4-0ubuntu1 Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP about net/mac80211/tx.c: have_bits = !bitmap_empty((unsigned long*)ps->tim, and net/mac80211/ieee80211_i.h d012a6051 (Marco Porsch 2012-10-10 12:39:50 -0700 244) struct ps_data { f0706e828 (Jiri Benc 2007-05-05 11:45:53 -0700 245) /* yes, this looks ugly, but guarantees that we can later use f0706e828 (Jiri Benc 2007-05-05 11:45:53 -0700 246) * bitmap_empty :) 004c872e7 (Johannes Berg 2008-02-20 11:21:35 +0100 247) * NB: don't touch this bitmap, use sta_info_{set,clear}_tim_bit */ f0706e828 (Jiri Benc 2007-05-05 11:45:53 -0700 248) u8 tim[sizeof(unsigned long) * BITS_TO_LONGS(IEEE80211_MAX_AID + 1)]; d012a6051 (Marco Porsch 2012-10-10 12:39:50 -0700 249) struct sk_buff_head bc_buf; 056cdd599 (Johannes Berg 2008-03-26 23:21:47 +0100 250) atomic_t num_sta_ps; /* number of stations in PS mode */ 5dfdaf58d (Johannes Berg 2007-12-19 02:03:33 +0100 251) int dtim_count; 512119b36 (Christian Lamparter 2011-01-31 20:48:44 +0200 252) bool dtim_bc_mc; f0706e828 (Jiri Benc 2007-05-05 11:45:53 -0700 253) }; Perhaps the u8 tim[sizeof...] member should be marked __aligned(sizeof(unsigned long)) so that the cast to ulong when bitmap_empty is actually forced to be ulong aligned? Perhaps the "guarantee" isn't valid without it. --- net/mac80211/ieee80211_i.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index ed5bf8b..e5a9c51 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -245,7 +245,8 @@ struct ps_data { /* yes, this looks ugly, but guarantees that we can later use * bitmap_empty :) * NB: don't touch this bitmap, use sta_info_{set,clear}_tim_bit */ - u8 tim[sizeof(unsigned long) * BITS_TO_LONGS(IEEE80211_MAX_AID + 1)]; + u8 tim[sizeof(unsigned long) * BITS_TO_LONGS(IEEE80211_MAX_AID + 1)] + __aligned(sizeof(unsigned long)); struct sk_buff_head bc_buf; atomic_t num_sta_ps; /* number of stations in PS mode */ int dtim_count;