[PATCH] make devmem map only a single page at end of memory

Denys Vlasenko vda.linux at googlemail.com
Thu Apr 15 15:31:50 UTC 2010


On Thu, Apr 15, 2010 at 12:37 AM, Michael Abbott
<michael at araneidae.co.uk> wrote:
> On Wed, 14 Apr 2010, Denys Vlasenko wrote:
>> On Tue, Apr 13, 2010 at 6:14 AM, Michael Abbott <michael at araneidae.co.uk> wrote:
>> > +       off_t page_mask = ~(off_t)(page_size - 1);
>> > +       size_t map_length;
>> >        int fd;
>> ...
>> >
>> > -       virt_addr = (char*)map_base + (target & (page_size - 1));
>> > +       virt_addr = (char*)map_base + (target & page_mask);
>>
>> Bug in the last line shown.
>
> Yes indeed, hurriedly corrected in a followup message, but easily missed.

I made my own fix because for such a simple problem, bikeshed painting effect
kicks in and everyone wants to (and is able to) do it himself. Sorry...

If you can make it do the same with smaller code...
-- 
vda


More information about the busybox mailing list