[PATCH 1/3] msi vector targeting abstractions

Grant Grundler grundler at parisc-linux.org
Thu Jan 12 18:33:09 EST 2006


On Thu, Jan 12, 2006 at 04:47:27PM +1100, Paul Mackerras wrote:
> Grant Grundler writes:
> 
> > > +	if ((status = msi_arch_init()) < 0) {
> > 
> > Willy told me I should always complain about assignment in if() statements :)
> 
> We are getting incredibly politically correct these days, aren't we.

I'm not asking greg to reject the patch nor dictating Mark Mauler change it.
Since greg is willing to accept a patch to "fix" it, I'm willing to provide 
the patch in this case. I think that's fairly normal way to clean things up.

> I see nothing wrong with that if statement.  It's perfectly valid,
> idiomatic C.  You can ignore Willy if you like. :)

While it is valid C, "=" occasionally gets confused with "==".
And adding unnecessary parens to an if() statement increases the
risk someone will misread the line.  "someone" includes me. :)

> (I would look askance at something that did an assignment as one of
> the parameters of a procedure call in an if statement, though.)

*nod* 

thanks,
grant



More information about the Linuxppc64-dev mailing list