[U-Boot] [PATCH v3 02/10] armv7: add miscellaneous utility macros

Simon Glass
2011-06-07T15:19:52Z

Hi Aneesh.

On Tue, Jun 7, 2011 at 5:14 AM, Aneesh V <aneesh@ti.com> wrote:
[snip]

> I am surprised why Linux doesn't have a solution for this. Perhaps the
> reason must be the confusion about the representation of a field that
> we discussed below. I suspect there may be non-standard local
> implementations in different modules.

I think there are a few reasons. Linux tends to do a lot more
processing in between bitfield accesses, so the problem is less
apparent (bitfield access as a proportion of total code size is
small). Also very often Linux supports all different values for a
field, so computing values to put into fields (based on function
parameters) is more common than just setting to a few selected values,
which is common in U-Boot.

>
> Also, as somebody already mentioned, can't we do better than Linux?

In this area, yes!

[snip]

>
> Please consider the above example and let me know if I missed any
> solution using the existing standard macros.
>
> best regards,
> Aneesh
>