Thread (31 messages) 31 messages, 6 authors, 2014-08-29
STALE4302d
Revisions (6)
  1. v1 [diff vs current]
  2. v1 [diff vs current]
  3. v1 [diff vs current]
  4. v1 [diff vs current]
  5. v1 [diff vs current]
  6. v1 current

[PATCH 2/9] arm64: Fix INVALID_HWID definition

From: catalin.marinas@arm.com (Catalin Marinas)
Date: 2014-08-27 08:21:39

On Tue, Aug 26, 2014 at 07:18:00PM +0100, Geoff Levand wrote:
On Tue, 2014-08-26 at 16:57 +0100, Catalin Marinas wrote:
quoted
On Fri, Aug 22, 2014 at 08:49:16PM +0100, Geoff Levand wrote:
quoted
Change the preprocessor macro INVALID_HWID definition from ULONG_MAX to (~0)
to allow INVALID_HWID to be used within assembly source files.
--- a/arch/arm64/include/asm/cputype.h
+++ b/arch/arm64/include/asm/cputype.h
@@ -16,7 +16,7 @@
 #ifndef __ASM_CPUTYPE_H
 #define __ASM_CPUTYPE_H
 
-#define INVALID_HWID		ULONG_MAX
+#define INVALID_HWID		UL(~0)
Does it actually expand to ULONG_MAX? ~0 is an int.
It seems to be OK, in C:

volatile unsigned long secondary_holding_pen_release = INVALID_HWID;

Disassembly of section .data:

0000000000000000 <secondary_holding_pen_release>:
   0:   ffffffff        .word   0xffffffff
   4:   ffffffff        .word   0xffffffff
OK, it looks like it's sign-extending from int to unsigned long (an
alternative would have been to write (~UL(0)) but the above should do as
well).

Anyway, the patch should come with the series that makes use of such
change.

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