[U-Boot] [PATCH 3/6] "return" is not a function

Guennadi Liakhovetski lg at denx.de
Sun Aug 31 21:17:32 CEST 2008


On Sun, 31 Aug 2008, Wolfgang Denk wrote:

> Dear Guennadi Liakhovetski,
> 
> In message <Pine.LNX.4.64.0808311805020.3747 at axis700.grange> you wrote:
> > 
> > > I don't see any need to change this code. Patch rejected.
> > 
> > return (0) and similar produce warnings from checkpatch.pl. If I followed 
> 
> Ah! Then you should have at least mentioned  in  your  comments  that
> this  was the motivation of your changes. As you posted it, it looked
> just like a change because you didn't like the style.

Sorry, will do in the next version, which, as it seems, will be necessary.

> > this local style and used parenthesis in all returns I added, all of them 
> > would cause checkpatch warnings. If I only added returns without 
> > parenthesis the mixed style would look terrible. So, I consider this a 
> > coding style clean up, just as well as any space vs. tab, or brace on the 
> > same line as if or for or...
> 
> Frankly, I don't understand what checkpatch  is  warning  about.  IMO
> this  is  really  just  a  matter f style, and I'm still using habits
> learned from K&R.

In my K&R second edition, which I just skipped over again, I haven't seen 
a single occurrence of "return (x)". No, I haven't checked every single 
return statement in the book, but I did come across a couple of dozens of 
them, they all just did "return x".

> If you had learned C from the Unix version  6  code
> like  me  you'd most probbaly write "return (value);", too. (Just for
> the fun of it I checked if my memory is with me - in the  whole  Unix
> v7  code,  kernel  + libraries + commands, I could find just 18 cases
> where "return value;" was used.)

ic.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.

DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de


More information about the U-Boot mailing list