public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 1/4] mmc: Change board_mmc_getcd() signature.
Date: Fri, 9 Dec 2011 10:12:42 +0100	[thread overview]
Message-ID: <201112091012.42481.marek.vasut@gmail.com> (raw)
In-Reply-To: <20111209084211.GA6666@avionic-0098.mockup.avionic-design.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

  reply	other threads:[~2011-12-09  9:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-09  7:11 [U-Boot] [PATCH v2 0/4] mmc: Implement central card-detection Thierry Reding
2011-12-09  7:11 ` [U-Boot] [PATCH v2 1/4] mmc: Change board_mmc_getcd() signature Thierry Reding
2011-12-09  8:32   ` Marek Vasut
2011-12-09  8:42     ` Thierry Reding
2011-12-09  9:12       ` Marek Vasut [this message]
2011-12-09  7:11 ` [U-Boot] [PATCH v2 2/4] mmc: Implement card detection Thierry Reding
2011-12-09  7:11 ` [U-Boot] [PATCH v2 3/4] mmc: fsl_esdhc: Implement card-detect hook Thierry Reding
2011-12-09  7:11 ` [U-Boot] [PATCH v2 4/4] mmc: tegra2: " Thierry Reding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201112091012.42481.marek.vasut@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox