public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: pm list <linux-pm@lists.linux-foundation.org>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Nigel Cunningham <nigel@nigel.suspend2.net>,
	Pavel Machek <pavel@ucw.cz>,
	Pekka Enberg <penberg@cs.helsinki.fi>
Subject: Re: [PATCH] swsusp: Do not use pm_ops
Date: Thu, 3 May 2007 11:46:02 +0200	[thread overview]
Message-ID: <200705031146.03358.rjw@sisk.pl> (raw)
In-Reply-To: <1178181680.13233.74.camel@johannes.berg>

On Thursday, 3 May 2007 10:41, Johannes Berg wrote:
> On Wed, 2007-05-02 at 22:13 +0200, Rafael J. Wysocki wrote:
> 
> > +void hibernation_set_ops(struct hibernation_ops *ops)
> > +{
> > +	if (ops && !(ops->prepare && ops->enter && ops->finish)) {
> > +		printk(KERN_ERR "Wrong definition of hibernation operations! "
> > +			"Using defaults\n");
> > +		return;
> > +	}
> 
> Why not BUG_ON here as I had before? I don't see much point in giving a
> runtime warning, and the docs clearly state that you must assign all
> three items. Oh, I see I had a bug before when ops was NULL, but you can
> still do
>   BUG_ON(ops && !(ops->prepare && ops->enter && ops->finish));

Well, BUG_ON() is extremely user-unfriendly, and it'd trigger even if the user
actually didn't intend to suspend at all.

IMO this is not a "we can't continue if that condition is not satisfied"
situation.
 
> > -	pr_debug("PM: suspend-to-disk mode set to '%s'\n",
> > -		 pm_disk_modes[mode]);
> > +	if (!error)
> > +		pr_debug("PM: suspend-to-disk mode set to '%s'\n",
> > +			 hibernation_modes[mode]);
> 
> Isn't that an unrelated bugfix ;) just kidding

You mean the 'if (!error)'?  Well ... ;-)

> Looks good to me but I haven't checked the acpi in detail. If I
> remember, I'll try to give it all a go on my G5 later today.

OK

Greetings,
Rafael

  reply	other threads:[~2007-05-03  9:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-02 20:13 [PATCH] swsusp: Do not use pm_ops Rafael J. Wysocki
2007-05-03  8:41 ` Johannes Berg
2007-05-03  9:46   ` Rafael J. Wysocki [this message]
2007-05-03  9:45     ` Johannes Berg
2007-05-03  9:52       ` Rafael J. Wysocki
2007-05-03 10:11     ` Pavel Machek
2007-05-03 10:18       ` Rafael J. Wysocki
2007-05-03 10:31 ` Nigel Cunningham
2007-05-03 12:12 ` Johannes Berg
2007-05-03 12:53   ` Rafael J. Wysocki
2007-05-03 12:13 ` Johannes Berg
2007-05-03 12:54   ` 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=200705031146.03358.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=johannes@sipsolutions.net \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=nigel@nigel.suspend2.net \
    --cc=pavel@ucw.cz \
    --cc=penberg@cs.helsinki.fi \
    /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