From: Wolfgang Denk Date: Wed, 09 Jan 2008 23:01:17 +0100 Subject: [U-Boot-Users] [PATCH V2] Fix Ethernet init() return codes. In-Reply-To: Your message of "Wed, 09 Jan 2008 19:26:08 +0100." <014701c852ed$4b0c4040$6103170a@atmel.com> Message-ID: <20080109220117.80CA424755@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de In message <014701c852ed$4b0c4040$6103170a@atmel.com> you wrote: > > Why not use symbolic return values? Because then nobody knows what the symbols mean. > "return SUCCESS;" seems much more appropriate than > "return 0;" or "return -1;" These constants are unmistakeable for anyone who ever wrote a program under any Unix system... > if(myfunction() == SUCCESS) { > > } > > is much more clear than > > if(myfunction()) { > > } Not to me. The former needs a lookup of the define, the latter is obvious. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Es gibt immer genug fuer die Beduerfnisse aller, aber niemals genug fuer die Gier einzelner. -- Ghandi