Re: [greybus-dev] [PATCH 1/8] driver core: Add helper for accessing Power Management callbacs

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

 



Hello Alex and Greg,

[...]
> This could just be:
> 
> 	if (drv)
> 		return drv->pm;
> 
> 	return NULL;
> 
> Or if you want to evoke passion in Greg:
> 
> 	return drv ? drv->pm : NULL;
> 
> 					-Alex
> 
> > I hate ? : lines with a passion, as they break normal pattern mattching
> > in my brain.  Please just spell this all out:
> > 	if (drv && drv->pm)
> > 		return drv->pm;
> > 	return NULL;
> > 
> > Much easier to read, and the compiler will do the exact same thing.
> > 
> > Only place ? : are ok to use in my opinion, are as function arguments.

I will steer away from the ternary operator next time.  Also, good to
learn about Greg's preference.

Thank you both!

Krzysztof



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux