From: Pavel Machek <pavel@ucw.cz>
To: Dave Hansen <haveblue@us.ibm.com>
Cc: Andrew Morton <akpm@osdl.org>,
kernel list <linux-kernel@vger.kernel.org>
Subject: Re: [swsusp] Rework image freeing
Date: Wed, 21 Sep 2005 23:23:11 +0200 [thread overview]
Message-ID: <20050921212311.GC2071@elf.ucw.cz> (raw)
In-Reply-To: <1127337482.10664.21.camel@localhost>
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
next prev parent reply other threads:[~2005-09-21 21:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-21 20:51 [swsusp] Rework image freeing Pavel Machek
2005-09-21 20:58 ` Andrew Morton
2005-09-21 21:19 ` Pavel Machek
2005-09-21 21:31 ` Andrew Morton
2005-09-21 21:11 ` Dave Hansen
2005-09-21 21:18 ` Dave Hansen
2005-09-21 21:23 ` Pavel Machek [this message]
2005-09-21 22:53 ` Rafael J. Wysocki
2005-09-22 4:54 ` Rafael J. Wysocki
2005-09-22 9:46 ` Pavel Machek
2005-09-23 20:52 ` Rafael J. Wysocki
2005-09-23 21:19 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050921212311.GC2071@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=akpm@osdl.org \
--cc=haveblue@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).