All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Seungwhan Youn <sw.youn@samsung.com>
Cc: alsa-devel@alsa-project.org, jassi.brar@samsung.com, lrg@slimlogic.co.uk
Subject: Re: [PATCH] ASoC: Fix to avoid compile error
Date: Mon, 4 Apr 2011 05:55:56 +0100	[thread overview]
Message-ID: <20110404045556.GA12690@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1301890504-14423-1-git-send-email-sw.youn@samsung.com>

On Mon, Apr 04, 2011 at 01:15:04PM +0900, Seungwhan Youn wrote:

>  	case SND_SOC_I2C:
> +#if defined(CONFIG_I2C) || (defined(CONFIG_I2C_MODULE) && defined(MODULE))
>  		ret = i2c_master_send(codec->control_data, data, len);
> +#endif
>  		break;
>  	case SND_SOC_SPI:
> +#if defined(CONFIG_SPI_MASTER)
>  		ret = do_spi_write(codec->control_data, data, len);
> +#endif
>  		break;

If we're going to ifdef these out we should be ifdefing out the entire
case, not just the operations.  Otherwise if we do manage to end up with
a broken configuration then the code will silently report success which
is broken - the fact that you have to initialise ret is a bad sign.

  reply	other threads:[~2011-04-04  4:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-04  4:15 [PATCH] ASoC: Fix to avoid compile error Seungwhan Youn
2011-04-04  4:55 ` Mark Brown [this message]
2011-04-04  4:43   ` [PATCHv2] " Seungwhan Youn
2011-04-04 23:23     ` Mark Brown
2011-04-04  5:05   ` [PATCH] " Seungwhan Youn

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=20110404045556.GA12690@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=jassi.brar@samsung.com \
    --cc=lrg@slimlogic.co.uk \
    --cc=sw.youn@samsung.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.