All of lore.kernel.org
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: Emmanuel Grumbach <egrumbach@gmail.com>
Cc: Seth Forshee <seth.forshee@canonical.com>,
	Jason Andrews <jasona@cadence.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: guidance on struct alignment for rtl8192cu driver
Date: Mon, 16 Sep 2013 14:40:19 -0500	[thread overview]
Message-ID: <52375EA3.4090408@lwfinger.net> (raw)
In-Reply-To: <CANUX_P3iBywud0SxXtnwUWby0DNm-UoB-CP=X+tdsS7MbmVg=Q@mail.gmail.com>

On 09/16/2013 02:29 PM, Emmanuel Grumbach wrote:
>>>> Index: wireless-testing-save/drivers/net/wireless/rtlwifi/wifi.h
>>>> ===================================================================
>>>> --- wireless-testing-save.orig/drivers/net/wireless/rtlwifi/wifi.h
>>>> +++ wireless-testing-save/drivers/net/wireless/rtlwifi/wifi.h
>>>> @@ -2057,7 +2057,7 @@ struct rtl_priv {
>>>>            that it points to the data allocated
>>>>            beyond  this structure like:
>>>>            rtl_pci_priv or rtl_usb_priv */
>>>> -       u8 priv[0];
>>>> +       u8 __aligned(4) priv[0];
>>>>    };
>>>
>>>
>>> __attribute__((aligned)) might be a safer bet, as this will align it to
>>> the largest alignment that could possibly be needed.
>
> Or copy the code from mac80211.h:
>
> u8 drv_priv[0] __aligned(sizeof(void *));
>
> I did the same in iwlwifi.
> Note the new way to add the __aligned thing. Joe will tell you that is
> better than __attribute__ blablabla

Thanks. I had noticed that checkpatch.pl complains about the __attribute 
construction.

Larry



  reply	other threads:[~2013-09-16 19:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-14  5:36 guidance on struct alignment for rtl8192cu driver Jason Andrews
2013-09-14 14:08 ` Larry Finger
2013-09-16 14:35   ` Seth Forshee
2013-09-16 15:33     ` Larry Finger
2013-09-16 19:29       ` Emmanuel Grumbach
2013-09-16 19:40         ` Larry Finger [this message]
2013-09-18  4:59           ` Jason Andrews

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52375EA3.4090408@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=egrumbach@gmail.com \
    --cc=jasona@cadence.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=seth.forshee@canonical.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.