From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mateusz Zalega Date: Mon, 13 Jan 2014 16:00:15 +0100 Subject: [U-Boot] [PATCH 8/9] ums: always initialize mmc before ums_disk_init() In-Reply-To: References: <1389277919-15279-1-git-send-email-m.zalega@samsung.com> <1389277919-15279-8-git-send-email-m.zalega@samsung.com> <52CF806B.1020406@samsung.com> <52D3FAA4.3030302@samsung.com> Message-ID: <52D3FF7F.6050408@samsung.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 01/13/14 15:43, Michael Trimarchi wrote: > On Mon, Jan 13, 2014 at 3:39 PM, Mateusz Zalega wrote: >> On 01/10/14 06:08, Jaehoon Chung wrote: >>>> index dc155ad..0d8f30d 100644 >>>> --- a/board/samsung/common/ums.c >>>> +++ b/board/samsung/common/ums.c >>>> @@ -37,6 +37,9 @@ static struct ums ums_dev = { >>>> >>>> static struct ums *ums_disk_init(struct mmc *mmc) >>>> { >>>> + if (mmc_init(mmc)) >>>> + return NULL; >>>> + >>>> uint64_t mmc_end_sector = mmc->capacity / SECTOR_SIZE; >>>> uint64_t ums_end_sector = UMS_NUM_SECTORS + UMS_START_SECTOR; >>> >>> --> if (mmc_init(mmc)) >>> return NULL; >>> >>> Locate this point. >> >> If you're asking to put this if() block after variable declaration, NAK. >> > > I don't understand your point > >> It's perfectly fine C99 code. I'm not aware of any existing U-Boot style >> guidelines that would forbid me to leave it this way. >> >> These variables are only meaningful when mmc_init() returns a valid pointer. >> > > http://www.denx.de/wiki/U-Boot/CodingStyle > > Michael touch? OK, I'll move declarations to the beginning of the closure, C89 style. Thanks, -- Mateusz Zalega Samsung R&D Institute Poland