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: <20110804122559.GC9959@opensource.wolfsonmicro.com>
Date:	Thu, 4 Aug 2011 21:26:01 +0900
From:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
To:	Marcus Folkesson <marcus.folkesson@...il.com>
Cc:	Liam Girdwood <lrg@...com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/4] regulator: tps65023: Set missing bit for update
 core-voltage

On Thu, Aug 04, 2011 at 01:33:50PM +0200, Marcus Folkesson wrote:

> +	if (vsel == tps->info[dcdc]->table_len) {
> +		ret = -EINVAL;
> +	} else {
> +		ret = tps_65023_reg_write(tps, TPS65023_REG_DEF_CORE, vsel);
> +
> +		/* Tell the chip that we have changed the value in DEFCORE
> +		 * and its time to update the core voltage
> +		 */
> +		tps_65023_set_bits(tps, TPS65023_REG_CON_CTRL2,
> +							TPS65023_REG_CTRL2_GO);
> +	}
> +
> +	return ret;

This seems convoluted and non-scalable if we add more things here - it'd
seem to be better to return an error and then have the write and so on
as part of the regular function rather than putting them within the else
clause.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ