On Wed, 2012-06-13 at 23:00 +0900, Takuya Yoshikawa wrote:
> On Wed, 13 Jun 2012 22:31:13 +0900
> Akinobu Mita <akinobu.m...@gmail.com> wrote:
> 
> > >> Should this hash_table be converted from u16 hash_table[32] to
> > >> DECLARE_BITMAP(hash_table, 16 * 32) to ensure that it is aligned
> > >> on long-word boundary?
> > >
> > > I think hash_table is already long-word aligned because it is placed
> > > right after a pointer.
> > 
> > I recommend converting to proper bitmap.  Because such an implicit
> > assumption is easily broken by someone touching this function.
> 
> Do you mean something like:
>       DECLARE_BITMAP(__hash_table, 16 * 32);
>       u16 *hash_table = (u16 *)__hash_table;
> ?
[...]

Could this driver perhaps use:

        union hash_table {
                DECLARE_BITMAP(bits, 16 * 32);
                __le16 words[32];
        };

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to