[PATCH] arm: new W macro to WORD_ACCESS

2009-09-16 Thread Sebastian Andrzej Siewior
As reported by Frans Pop the new global macro W on ARM which is included
via
|arch/arm/include/asm/uaccess.h:20
|include/linux/uaccess.h:5
|include/linux/crypto.h:26
|crypto/cast6.c:23

leads to a build error because the crypto/cast6.c defines a function
which is named W.

Reported-by: Frans Pop elen...@planet.nl
Signed-off-by: Sebastian Andrzej Siewior sebast...@breakpoint.cc
---
* Frans Pop | 2009-09-16 16:01:34 [+0200]:

Maybe it's a result of enabling the new config option CRYPTO_DEV_MV_CESA?
please don't blame my shiny new driver :)

Catalin: bisect leads to 8b592783a. I've renamed the macro in this
commit and everything else I found due to compile error. Hope the new
name is acceptable. I think W in global name space is a bad thing to do.
In crypto there are many one letter identifier.
Since you use this in assembly code only you might want to move it to
another header file which does get included from every .c file.

 arch/arm/boot/compressed/head.S |   96 +++---
 arch/arm/include/asm/unified.h  |4 +-
 arch/arm/kernel/entry-armv.S|   50 ++--
 arch/arm/lib/copy_from_user.S   |2 +-
 arch/arm/lib/copy_template.S|4 +-
 arch/arm/lib/copy_to_user.S |2 +-
 arch/arm/lib/memcpy.S   |4 +-
 arch/arm/lib/memmove.S  |   28 ++--
 8 files changed, 95 insertions(+), 95 deletions(-)

diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index fa6fbf4..6939dd0 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -612,8 +612,8 @@ call_cache_fn:  adr r12, proc_types
 proc_types:
.word   0x41560600  @ ARM6/610
.word   0xffe0
-   W(b)__arm6_mmu_cache_off@ works, but slow
-   W(b)__arm6_mmu_cache_off
+   WORD_ACCESS(b)  __arm6_mmu_cache_off@ works, but slow
+   WORD_ACCESS(b)  __arm6_mmu_cache_off
mov pc, lr
  THUMB(nop )
 @  b   __arm6_mmu_cache_on @ untested
@@ -631,29 +631,29 @@ proc_types:
 
.word   0x41007000  @ ARM7/710
.word   0xfff8fe00
-   W(b)__arm7_mmu_cache_off
-   W(b)__arm7_mmu_cache_off
+   WORD_ACCESS(b)  __arm7_mmu_cache_off
+   WORD_ACCESS(b)  __arm7_mmu_cache_off
mov pc, lr
  THUMB(nop )
 
.word   0x41807200  @ ARM720T (writethrough)
.word   0xff00
-   W(b)__armv4_mmu_cache_on
-   W(b)__armv4_mmu_cache_off
+   WORD_ACCESS(b)  __armv4_mmu_cache_on
+   WORD_ACCESS(b)  __armv4_mmu_cache_off
mov pc, lr
  THUMB(nop )
 
.word   0x41007400  @ ARM74x
.word   0xff00ff00
-   W(b)__armv3_mpu_cache_on
-   W(b)__armv3_mpu_cache_off
-   W(b)__armv3_mpu_cache_flush
+   WORD_ACCESS(b)  __armv3_mpu_cache_on
+   WORD_ACCESS(b)  __armv3_mpu_cache_off
+   WORD_ACCESS(b)  __armv3_mpu_cache_flush

.word   0x41009400  @ ARM94x
.word   0xff00ff00
-   W(b)__armv4_mpu_cache_on
-   W(b)__armv4_mpu_cache_off
-   W(b)__armv4_mpu_cache_flush
+   WORD_ACCESS(b)  __armv4_mpu_cache_on
+   WORD_ACCESS(b)  __armv4_mpu_cache_off
+   WORD_ACCESS(b)  __armv4_mpu_cache_flush
 
.word   0x7000  @ ARM7 IDs
.word   0xf000
@@ -668,39 +668,39 @@ proc_types:
 
.word   0x4401a100  @ sa110 / sa1100
.word   0xffe0
-   W(b)__armv4_mmu_cache_on
-   W(b)__armv4_mmu_cache_off
-   W(b)__armv4_mmu_cache_flush
+   WORD_ACCESS(b)  __armv4_mmu_cache_on
+   WORD_ACCESS(b)  __armv4_mmu_cache_off
+   WORD_ACCESS(b)  __armv4_mmu_cache_flush
 
.word   0x6901b110  @ sa1110
.word   0xfff0
-   W(b)__armv4_mmu_cache_on
-   W(b)__armv4_mmu_cache_off
-   W(b)__armv4_mmu_cache_flush
+   WORD_ACCESS(b)  __armv4_mmu_cache_on
+   WORD_ACCESS(b)  __armv4_mmu_cache_off
+   WORD_ACCESS(b)  __armv4_mmu_cache_flush
 
.word   0x56056930
.word   0xff00  @ PXA935
-   W(b)__armv4_mmu_cache_on
-   W(b)__armv4_mmu_cache_off
-   W(b)__armv4_mmu_cache_flush
+   WORD_ACCESS(b)  __armv4_mmu_cache_on
+  

Re: [PATCH] arm: new W macro to WORD_ACCESS

2009-09-16 Thread Russell King - ARM Linux
On Wed, Sep 16, 2009 at 07:58:12PM +0200, Sebastian Andrzej Siewior wrote:
 leads to a build error because the crypto/cast6.c defines a function
 which is named W.

W has nothing to do with the access size, so this change makes it _really_
confusing.  What it's about is telling the compiler to use the ARM 32-bit
version of the instruction coding when building for Thumb2 (which
can intermix Thumb and ARM instruction sets.)

So the macro needs to be renamed... NAK on this patch as it stands.
--
To unsubscribe from this list: send the line unsubscribe linux-crypto in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] arm: new W macro to WORD_ACCESS

2009-09-16 Thread Catalin Marinas
On Wed, 2009-09-16 at 19:58 +0200, Sebastian Andrzej Siewior wrote:
 As reported by Frans Pop the new global macro W on ARM which is included
 via
 |arch/arm/include/asm/uaccess.h:20
 |include/linux/uaccess.h:5
 |include/linux/crypto.h:26
 |crypto/cast6.c:23
 
 leads to a build error because the crypto/cast6.c defines a function
 which is named W.

This was already reported by Alexey Dobriyan and I included his patch in
my Thumb-2 branch (and -next for now):

http://linux-arm.org/git?p=linux-2.6.git;a=commitdiff;h=4fb3c2e2ab3549308a1b1663296d165e45d72ba5

Since this macro is only used in ARM assembly code, the patch simply
adds some ifdefs around it.

Russell, if you are OK with Alexey's patch, I'll send you a pull request
(though for only one patch, alternatively just merge it manually).

-- 
Catalin

--
To unsubscribe from this list: send the line unsubscribe linux-crypto in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html