On Tuesday, 26 September 2006 13:02, Stefan Seyfried wrote:
> On Tue, Sep 26, 2006 at 11:48:51AM +0200, Rafael J. Wysocki wrote:
> > On Monday, 25 September 2006 23:35, Pavel Machek wrote:
>  
> > > > Implement the userspace part of "use platform mode to suspend machines".
> > > > 
> > > > Index: suspend.c
> > > > ===================================================================
> > > > RCS file: /cvsroot/suspend/suspend/suspend.c,v
> > > > retrieving revision 1.57
> > > > diff -u -p -r1.57 suspend.c
> > > > --- suspend.c   24 Sep 2006 08:09:59 -0000      1.57
> > > > +++ suspend.c   25 Sep 2006 17:37:53 -0000
> > > > @@ -67,7 +67,7 @@ static char s2ram;
> > > >  static char early_writeout;
> > > >  static char splash_param;
> > > >  #define SHUTDOWN_LEN   16
> > > > -static char shutdown_method[SHUTDOWN_LEN];
> > > > +static char shutdown_method[SHUTDOWN_LEN] = "platform";
> > > >  
> > > >  static int suspend_swappiness = SUSPEND_SWAPPINESS;
> > > >  static struct splash splash;
> > > > @@ -659,13 +659,18 @@ static int reset_signature(int fd)
> > > >  }
> > > >  #endif
> > > >  
> > > > -static void suspend_shutdown(void)
> > > > +static void suspend_shutdown(int dev)
> > > 
> > > Can you perhaps call the parameter "snapshot_fd" to be consistent with
> > > rest of code?
> 
> Ok,
> 
> > > 
> > > > @@ -99,6 +104,21 @@ static inline int atomic_restore(int dev
> > > >         return ioctl(dev, SNAPSHOT_ATOMIC_RESTORE, 0);
> > > >  }
> > > >  
> > > > +static inline int platform_prepare(int dev)
> > > > +{
> > > > +       return ioctl (dev, SNAPSHOT_PMOPS, PMOPS_FINISH);
> > >                 ~ please do not  add space between function and
> > >                   its arguments
> 
> Yes, sorry for that
> 
> > > Otherwise looks okay to me.
> > 
> > I'd prefer to have a variable, say use_platform_suspend, that is set to one
> > in main() if shutdown_method contains the string "platform", so that we can
> > get rid of the repeated strcmp(shutdown_method, "platform") invocations.
> 
> Yes, this was basically the first incarnation of the patch, then i figured
> that a global variable might not be the best solution. I do not really care
> though, so will change that.
> 
> > Also, when platform_finish() is called, the variable ret is not necessary, 
> > and
> > we don't intend to implement S3 in suspend_shutdown() (s2both is for that).
> 
> Ok.
> 
> Next try:

Looks good.

Greetings,
Rafael


-- 
You never change things by fighting the existing reality.
                R. Buckminster Fuller

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Suspend-devel mailing list
Suspend-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/suspend-devel

Reply via email to