LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Andi Kleen <ak@suse.de>, LKML <linux-kernel@vger.kernel.org>,
	Pavel Machek <pavel@ucw.cz>,
	pm list <linux-pm@lists.linux-foundation.org>
Subject: Re: [PATCH -mm 2/2] Hibernation: Arbitrary boot kernel support on x86_64
Date: Sat, 25 Aug 2007 22:32:42 +0200	[thread overview]
Message-ID: <200708252232.43478.rjw@sisk.pl> (raw)
In-Reply-To: <20070824162346.ec57f508.akpm@linux-foundation.org>

On Saturday, 25 August 2007 01:23, Andrew Morton wrote:
> On Fri, 24 Aug 2007 12:11:54 +0200
> "Rafael J. Wysocki" <rjw@sisk.pl> wrote:
> 
> > Index: linux-2.6.23-rc3/include/asm-x86_64/suspend.h
> > ===================================================================
> > --- linux-2.6.23-rc3.orig/include/asm-x86_64/suspend.h	2007-08-21 20:36:49.000000000 +0200
> > +++ linux-2.6.23-rc3/include/asm-x86_64/suspend.h	2007-08-21 20:37:47.000000000 +0200
> > @@ -43,4 +43,10 @@ extern void fix_processor_context(void);
> >  /* routines for saving/restoring kernel state */
> >  extern int acpi_save_state_mem(void);
> >  
> > +#define ARCH_HAS_HIBERNATION_HEADER
> 
> The preferred way of doing this is via Kconfig, please.  ie: add a
> CONFIG_HIBERNATION_HEADER to arch/x86_64/Kconfig.

OK

> > +
> > +/* arch/x86_64/kernel/suspend.c */
> > +extern int arch_hibernation_header_save(void *addr, unsigned int max_size);
> > +extern int arch_hibernation_header_restore(void *addr);
> 
> Given that these are called from non-arch-specific code, they must have the
> same signature across all architectures.  So there's no point in putting
> the prototypes into an arch-specific header file.
> 
> It would be better to do something like this in (say) suspend.h:
> 
> #ifdef CONFIG_HIBERNATION_HEADER
> extern int arch_hibernation_header_save(void *addr, unsigned int max_size);
> extern int arch_hibernation_header_restore(void *addr);
> #else
> static inline int arch_hibernation_header_save(void *addr,
> 						unsigned int max_size)
> {
> 	return 0;
> }
> 
> static inline int arch_hibernation_header_restore(void *addr)
> {
> 	return 0;
> }
> #endif
> 
> then go nuke some ifdefs from the .c files.

The ifdefs in snapshot.c are necessary anyway, because they are around some
code that is only compiled when the CONFIG_HIBERNATION_HEADER is undefined.

I'll post the reworked patches in a new thread once again after the other issue
raised by Pavel gets settled.

      parent reply	other threads:[~2007-08-25 20:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-24 10:06 [PATCH -mm 0/2] " Rafael J. Wysocki
2007-08-24 10:09 ` [PATCH -mm 1/2] Hibernation: Arbitrary boot kernel support - generic code Rafael J. Wysocki
2007-08-24 10:11 ` [PATCH -mm 2/2] Hibernation: Arbitrary boot kernel support on x86_64 Rafael J. Wysocki
2007-08-24 10:59   ` [linux-pm] " Johannes Berg
2007-08-24 13:11     ` Rafael J. Wysocki
2007-08-24 20:46   ` Pavel Machek
2007-08-25 18:27     ` Rafael J. Wysocki
2007-08-25 18:32       ` david
2007-08-25 19:51         ` Rafael J. Wysocki
2007-08-25 20:42       ` [PATCH -mm 2/2] Hibernation: Arbitrary boot kernel support on x86_64 (updated) Rafael J. Wysocki
2007-08-27  8:28         ` Pavel Machek
2007-08-24 23:23   ` [PATCH -mm 2/2] Hibernation: Arbitrary boot kernel support on x86_64 Andrew Morton
2007-08-25 19:13     ` [linux-pm] " Johannes Berg
2007-08-27 11:06       ` Rafael J. Wysocki
2007-08-27 11:09         ` Johannes Berg
2007-08-27 11:12       ` Rafael J. Wysocki
2007-08-25 20:32     ` Rafael J. Wysocki [this message]

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=200708252232.43478.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=pavel@ucw.cz \
    --subject='Re: [PATCH -mm 2/2] Hibernation: Arbitrary boot kernel support on x86_64' \
    /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

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).