Thread (24 messages) 24 messages, 4 authors, 2013-02-26

Lifecycle

  1. Posted linux@arm.linux.org.uk (Russell King - ARM Linux)

[PATCH 2/4] ARM: tegra: pmc: add power on function for secondary CPUs

From: Russell King - ARM Linux <hidden>
Date: 2013-02-23 09:39:05
Also in: linux-tegra

On Sat, Feb 23, 2013 at 03:28:00PM +0800, Joseph Lo wrote:
On Sat, 2013-02-23 at 02:37 +0800, Stephen Warren wrote:
quoted
On 02/21/2013 11:44 PM, Joseph Lo wrote:
quoted
+	id = tegra_pmc_get_cpu_powerdomain_id(cpuid);
+	if (IS_ERR_VALUE(id))
+		return false;
As I pointed out downstream, that should be if (id < 0); IS_ERR_VALUE is
intended for use on error-pointers, not on integer error codes.
IS_ERR is for error pointers, IS_ERR_VALUE is for error return code,
isn't it?
No.  Just because there's a macro somewhere doesn't mean it should be used.

The err.h stuff is only there to deal with functions which can return
kernel pointer values and error values, and resolve the conflict between
negative integers and pointers which also appear to be negative integers.

If you don't have that conflict, then making use of err.h is pointless
and is pure obfuscation.

So, just use the plain:

	if (id < 0)
		return false;

here.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help