From mboxrd@z Thu Jan 1 00:00:00 1970 From: Timur Tabi Date: Mon, 07 Jun 2010 17:55:18 -0500 Subject: [U-Boot] [PATCH] [v2] tsec: fix the return value for tsec_eth_init() and tsec_standard_init() In-Reply-To: <201006071849.29511.vapier@gentoo.org> References: <1275935487-2031-1-git-send-email-timur@freescale.com> <201006071849.29511.vapier@gentoo.org> Message-ID: <4C0D78D6.2010707@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Mike Frysinger wrote: > On Monday, June 07, 2010 14:31:27 Timur Tabi wrote: >> In general, if an function initializes only one device, then it should >> return a negative number if there's an error. If it initializes more than >> one device, then it should never return a negative number. This is why >> these functions now return an unsigned integer. > > i dont think this is a good idea. either the init funcs should all be > converted to unsigned int, or they should stay int. doing it piecemeal leads > to confusion with zero upside. I don't want to change all of the functions. For most devices, there's no way I can test them. Just because pci_eth_int() is incorrect, that doesn't mean that I can't make tsec_eth_init() correct. > your fixes no way require these to be unsigned int funcs. What's the point of making the return value a signed integer if it can never be a negative number? The reason I changed the type to unsigned int is to make it very clear that it will never return an error code.