lkml.org 
[lkml]   [2008]   [May]   [16]   [last100]   RSS Feed
Views: [more markup]   [less markup]   [headers]   [forward]  
 
Messages in this thread
/
DateFri, 16 May 2008 10:32:10 -0400 (EDT)
FromAlan Stern <>
SubjectRe: [PATCH] usb: file-storage.c use unaligned access helpers
On Thu, 15 May 2008, Harvey Harrison wrote:

> Replace the put_be16/32 and get_be16/32 helpers with the
> common unaligned access routines.  Note that these put_ helpers
> had the pointer/value parameter in the opposite order from the
> common version.

This is fine and it's what I requested.  Still, it's not really the 
best solution.

In many of the places where these helpers are used, we _know_ that the
buffers are in fact aligned properly.  For example, in code like this:

> -			put_be16(&buf[4], 0xffff);
> +			put_unaligned_be16(0xffff, &buf[4]);

we know that buf is aligned.  It would be great if there were helpers 
which would allow us to do

			put_be16(&buf[4], 0xffff);
instead of

			* (__be16 *) &buf[4] = cpu_to_be16(0xffff);
They could also be used to clean up the disputed HCD code.  Is this a
reasonable thing to ask for?  A few simple, arch-independent macros
would be sufficient.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2008-05-16 14:35    [from the cache]
©2003-2008