[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20130822.220236.2202751653391527307.davem@davemloft.net>
Date: Thu, 22 Aug 2013 22:02:36 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: bhutchings@...arflare.com
Cc: netdev@...r.kernel.org, linux-net-drivers@...arflare.com
Subject: Re: [PATCH RESEND net-next 06/16] sfc: Introduce and use
MCDI_DECLARE_BUF macro
From: Ben Hutchings <bhutchings@...arflare.com>
Date: Thu, 22 Aug 2013 20:26:49 +0100
> MCDI_DECLARE_BUF declares a variable as an MCDI buffer of the
> requested length, adding any necessary padding.
>
> Signed-off-by: Ben Hutchings <bhutchings@...arflare.com>
There really isn't a guarentee that a u8 array is going to
aligned appropriately to write dwords there using casts like
you do.
Since you're here macro'izing the declaration, take the time to fix it
to specify the necessary alignment as well.
You probably are getting lucky and this works because the size of
all the stack items allocated by gcc for these functions all are
sized such that nothing ends up being unaligned. But code should not
work by luck :-)
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists