Re: [PATCH 1/5] SDIO: introduce API for special power management features

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

 



On Thu, 11 Feb 2010, Andrew Morton wrote:

> On Tue, 09 Feb 2010 15:29:22 -0500
> Nicolas Pitre <nico@xxxxxxxxxxx> wrote:
> 
> > +	BUG_ON(!func);
> > +	BUG_ON(!func->card);
> > +
> > +	host = func->card->host;
> 
> It's a bit redundant to check for null and then deref the pointer - the
> kernel will reliably oops on the NULL deref, which gives us the same
> info.
> 
> I guess the BUG_ON is more useful in the case where a double-deref is
> being performed, as it can otherwise be a bit hard to work out which
> pointer was NULL.

The actual reason for those is to follow the same pattern as found in 
surrounding functions.  I personally think there are a bit too many of 
those but Pierre Ossman liked them.


Nicolas
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux