lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150114192703.GH3043@sirena.org.uk>
Date:	Wed, 14 Jan 2015 19:27:03 +0000
From:	Mark Brown <broonie@...nel.org>
To:	Zidan Wang <zidan.wang@...escale.com>
Cc:	lgirdwood@...il.com, perex@...ex.cz, tiwai@...e.de,
	lars@...afoo.de, ckeepax@...nsource.wolfsonmicro.com,
	patches@...nsource.wolfsonmicro.com, alsa-devel@...a-project.org,
	linux-kernel@...r.kernel.org, Zidan Wang <b50113@...escale.com>
Subject: Re: [alsa-devel][PATCH v2 2/2] ASoC: wm8960: Let wm8960 driver
 configure its bit clock and frame clock

On Wed, Jan 07, 2015 at 03:31:45PM +0800, Zidan Wang wrote:

> +	for (i = 0; i < ARRAY_SIZE(dac_divs); ++i) {
> +		if (wm8960->sysclk == lrclk * dac_divs[i]) {
> +			for (j = 0; j < ARRAY_SIZE(bclk_divs); ++j) {
> +				if (wm8960->sysclk ==  wm8960->bclk *
> +						bclk_divs[j] / 10) {
> +					goto config_clock;
> +				}
> +			}
> +		}
> +	}
> +
> +	dev_err(codec->dev, "Unsupported sysclk %d\n", wm8960->sysclk);
> +	return;

It's a bit awkward using the goto like this.  A more common way of
writing this is to change the above block to be

	if (i == ARRAY_SIZE(dac_divs))
		/* return error */

rather than skipping over the error.  Otherwise this looks good.

Download attachment "signature.asc" of type "application/pgp-signature" (474 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ