From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sonic Zhang Date: Mon, 18 Feb 2013 15:38:57 +0800 Subject: [U-Boot] [PATCH 08/11] Blackfin: bf60x: add rsi/sdh support In-Reply-To: <20130217201511.3CCA22005E0@gemini.denx.de> References: <1360223258-6945-1-git-send-email-sonic.adi@gmail.com> <1360223258-6945-9-git-send-email-sonic.adi@gmail.com> <20130207101742.A06F0200565@gemini.denx.de> <20130217201511.3CCA22005E0@gemini.denx.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Wolfgang, On Mon, Feb 18, 2013 at 4:15 AM, Wolfgang Denk wrote: > Dear Sonic Zhang, > > In message you wrote: >> >> >> @@ -113,16 +131,19 @@ static int sdh_setup_data(struct mmc *mmc, struct mmc_data *data) >> > ... >> >> - int ret = 0; >> > ... >> >> - return ret; >> >> + return 0; >> > >> > If this function can always only return 0, then please make it void. >> > >> > Please fix globally. >> >> I am sorry, this function can't be changed to void, because it may >> return error. See bellow code. > > You are contradicting yourself. You _always_ return a 0 here. Your > code CANNOT return an error code. > Maybe I didn't describe it clearly. Yes, I return 0 at the end of this function. But, the same function may return UNUSABLE_ERR(-17) at the beginning if the data flags match MMC_DATA_WRITE. That's why the function can't return void. Is anything contradicting in my explanation? @@ -113,16 +131,19 @@ static int sdh_setup_data(struct mmc *mmc, struct mmc_data *data) { u16 data_ctl = 0; u16 dma_cfg = 0; - int ret = 0; unsigned long data_size = data->blocksize * data->blocks; /* Don't support write yet. */ if (data->flags & MMC_DATA_WRITE) return UNUSABLE_ERR; @@ -137,7 +158,7 @@ static int sdh_setup_data(struct mmc *mmc, struct mmc_data *data) /* kick off transfer */ bfin_write_SDH_DATA_CTL(bfin_read_SDH_DATA_CTL() | DTX_DMA_E | DTX_E); - return ret; + return 0; } Regards, Sonic Zhang