lkml.org 
[lkml]   [2005]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [swsusp] Rework image freeing
Hi!

> > +static long alloc_image_page(void)
> > +{
> > + long res = get_zeroed_page(GFP_ATOMIC | __GFP_COLD);
> > + if (res) {
> > + SetPageNosave(virt_to_page(res));
> > + SetPageNosaveFree(virt_to_page(res));
> > + }
> > + return res;
> > +}
>
> Please avoid using longs here. "res" really is a virtual address, and
> it would be polite to keep it in a pointer of some kind. Returning
> void* would also avoid the two casts in alloc_pagedir(). The same
> probably goes for pbe->address and pbe->orig_address.
>
> BTW, I think get_zeroed_page() returns a long to keep people from
> confusing it with the allocator routines that return actual 'struct page
> *', and not the page's virtual address. So, you really should be
> casting them to real pointers as soon as it comes back from
> get_zeroed_page() and cousins.

Okay, but that's another patch, as I'll have to do s/long/void */ on
whole file. address/orig_address is used at lot of places.

Pavel

--
if you have sharp zaurus hardware you don't need... you know my address
-
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: 2005-09-21 23:25    [W:0.087 / U:0.640 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site