[PATCH v2 2/2] net: flexcan: add transceiver switch gpios support

Dong Aisheng aisheng.dong at freescale.com
Thu Jun 28 08:11:26 EDT 2012


On Thu, Jun 28, 2012 at 08:05:24PM +0800, Shawn Guo wrote:
> On Thu, Jun 28, 2012 at 07:52:26PM +0800, Shawn Guo wrote:
> > Do you care the variable name also?  If so, we will get:
> > 
> >         int transceiver_en_gpio;
> >         int transceiver_stby_gpio;
> >         bool transceiver_en_high;
> >         bool transceiver_stby_high;
> > 
> > So everything becomes long :)
> > 
> Oh, even longer, since we have agreed "high" should be renamed to
> "active_low":
> 
> 	bool transceiver_en_active_low;
> 	bool transceiver_stby_active_low;
> 
How about just active_low since they're just temp variables?

And if you do not assign them together at last, you may only need:
int gpio;
bool active_high;

That saves you two variables.

Regards
Dong Aisheng




More information about the linux-arm-kernel mailing list