Re: [PATCH] swsusp: Do not use pm_ops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm

[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux