From: Wolfgang Denk Date: Tue, 21 May 2013 23:24:46 +0200 Subject: [U-Boot] [PATCH 1/9] wandboard: Return error if the SDHC port index is invalid In-Reply-To: <1369157542-25734-1-git-send-email-fabio.estevam@freescale.com> References: <1369157542-25734-1-git-send-email-fabio.estevam@freescale.com> Message-ID: <20130521212446.6C7BC383531@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 Dear Fabio Estevam, In message <1369157542-25734-1-git-send-email-fabio.estevam@freescale.com> you wrote: > When the SDHC port number index is invalid we should return an error code > immediately. > > Currently we return 'status', which has a value of zero, causing > board_mmc_init() to incorrectly return sucess. > > Fix this by returning -EINVAL instead. Can we _please_ remove all this code? A _runtime_ check for a _build_ _time_ _detectable_ situation makes no sense to me. For such a misconfiguration, the build should fail. Handling this at runtime is the wrong approach. This comment applies for the whole series. Actually - are you not surprised that you have to fix the same issue for all boards? This is a clear indication of duplicated code that needs to be factored out. 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 There are two kinds of people, those who do the work and those who take the credit. Try to be in the first group; there is less competition there. - Indira Gandhi