From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Fri, 9 Dec 2011 10:12:42 +0100 Subject: [U-Boot] [PATCH v2 1/4] mmc: Change board_mmc_getcd() signature. In-Reply-To: <20111209084211.GA6666@avionic-0098.mockup.avionic-design.de> References: <1323414678-4291-1-git-send-email-thierry.reding@avionic-design.de> <201112090932.19778.marek.vasut@gmail.com> <20111209084211.GA6666@avionic-0098.mockup.avionic-design.de> Message-ID: <201112091012.42481.marek.vasut@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de > * Marek Vasut wrote: > > By "signature" you mean signedness ? > > No, I mean "signature" as synonymous to "function prototype". Please say so then, it was slightly confusing. > > [...] > > > > -int board_mmc_getcd(u8 *absent, struct mmc *mmc) > > > +int board_mmc_getcd(struct mmc *mmc) > > > > > > { > > > > > > struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv; > > > uint32_t cd = efika_mmc_cd(); > > > > > > if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR) > > > > > > - *absent = gpio_get_value(IOMUX_TO_GPIO(cd)); > > > - else > > > - *absent = gpio_get_value(IOMUX_TO_GPIO(MX51_PIN_GPIO1_8)); > > > + return !gpio_get_value(IOMUX_TO_GPIO(cd)); > > > > > > - return 0; > > > + return !gpio_get_value(IOMUX_TO_GPIO(MX51_PIN_GPIO1_8)); > > > > int ret; > > > > if (cfg->...) > > > > ret = ... > > > > else > > > > ret = ... > > > > return ret; > > That'll require an extra variable and will actually be longer. I don't see > any advantage in converting it. It's slightly more readable IMO, but that's a matter of personal taste so I'd like others to comment on this one. > > > DTTO here please, also add spaces into the comment ... /* GPIO1_4 */ > > I was going to keep that as it was, but I guess since I'm already changing > the line I can as well clean it up. > > Thierry Thanks! M