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: <20140714180114.GJ6800@sirena.org.uk>
Date:	Mon, 14 Jul 2014 19:01:14 +0100
From:	Mark Brown <broonie@...nel.org>
To:	Charles Keepax <ckeepax@...nsource.wolfsonmicro.com>
Cc:	Laxman Dewangan <ldewangan@...dia.com>, milo.kim@...com,
	support.opensource@...semi.com,
	patches@...nsource.wolfsonmicro.com, lgirdwood@...il.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] regulator: drivers: fix return value of get_mode callback

On Mon, Jul 14, 2014 at 12:57:18PM +0100, Charles Keepax wrote:
> On Mon, Jul 14, 2014 at 04:03:17PM +0530, Laxman Dewangan wrote:

> > The function get_mode() should return 0 on error and REGULATOR_MODE_*
> > on success. The return type of this function is defined as unsigned int.

> Looks like _regulator_get_mode in core.c would need updated too.
> I can't help but wonder if it might be better to just make
> get/set mode use an int instead, although I don't know for what
> reasons an unsigned int was choosen in the first place so I might
> be missing something.

It's because it's returning something defined as a bitmask, though since
we don't even have enough modes for 8 bits that's not really a strong
reason and we should just be returning an error code as everyone is
clearly already assuming we do.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ