Re: [PATCH 05/29] regulator: use IS_ERR_OR_NULL() instead of open-coding

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

 



On Mon, Jun 11, 2012 at 01:38:13PM +0200, Guennadi Liakhovetski wrote:
> On Fri, 18 May 2012, Mark Brown wrote:

> > This is checking the value of regulator_get(), NULL is a perfectly valid
> > regulator value to get passed back.

> Sorry, could you clarify, how it is valid? No, I'm not proposing to revive 
> this patch, just curious, what exactly you meant by this. AFAICS NULL is 
> never returned from regulator_get(). The value, that's returned by it is 
> then directly dereferenced in other regulator API calls, for which you 
> don't normally want a NULL. So, having a regulator pointer == NULL seems 
> to be as valid to me as causing a BUG() is? :-)

The stubs return NULL and we could decide in future to use NULL for
something else (though that seems unlikely).

Attachment: signature.asc
Description: Digital signature


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

  Powered by Linux