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

On Thursday, 3 May 2007 12:11, Pavel Machek wrote:
> On Thu 2007-05-03 11:46:02, Rafael J. Wysocki wrote:
> > 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.
> 
> WARN_ON()?

Sure, why not.

Greetings,
Rafael

  reply	other threads:[~2007-05-03 10:14 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
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 [this message]
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=200705031218.59256.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