OMAP: fix fncpy API call
Subsystems (2)
PATCH v2 1/1 OMAP: fix fncpy API call
From: Jean Pihet <[email protected]>
Fix a potential problem with function types when calling the fncpy API to copy the PM code functions to SRAM.
--- arch/arm/plat-omap/include/plat/sram.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/plat-omap/include/plat/sram.h +2 -2
@@ -18,10 +18,10 @@ extern void *omap_sram_push_address(unsigned long size);/* Macro to push a function to the internal SRAM, using the fncpy API */ #define omap_sram_push (funcp, size) ({ \ - typeof(&funcp) _res = NULL; \ + typeof(&(funcp)) _res = NULL; \ void *_sram_address = omap_sram_push_address(size); \ if (_sram_address) \ - _res = fncpy(_sram_address, &funcp, size); \ + _res = fncpy(_sram_address, &(funcp), size); \ _res; \ })
Signature · 1 line
1.7.1
Quoted 17 lines · On Tue, Jan 25, 2011 at 6:48 PM, <[email protected]> wrote:
From: Jean Pihet <[email protected]>
Fix a potential problem with function types when calling the fncpy API to copy the PM code functions to SRAM.
Signed-off-by Jean Pihet <[email protected]>---
arch/arm/plat-omap/include/plat/sram.h | 4 ++--1 files changed, 2 insertions(+), 2 deletions(-)arch/arm/plat-omap/include/plat/sram.h +0
-0@@ -18,10 +18,10 @@ extern void *omap_sram_push_address(unsigned long size); /* Macro to push a function to the internal SRAM, using the fncpy API */
arch/arm/plat-omap/include/plat/sram.h extern void *omap_sram_push_address(unsigned long size); · line 27
Quoted 10 lines
arch/arm/plat-omap/include/plat/sram.h +2
-2#define omap_sram_push(funcp, size) ({ \ - typeof(&funcp) _res = NULL; \ + typeof(&(funcp)) _res = NULL; \ void *_sram_address = omap_sram_push_address(size); \ if (_sram_address) \ - _res = fncpy(_sram_address, &funcp, size); \ + _res = fncpy(_sram_address, &(funcp), size); \ _res; \ })
Dave, Tony,
Are you OK with this version?
If so can it added to the tree? It is a follow-up of commit 021222e9988acbf3bb6fabffc667bab0bb207c54
'omap: use fncpy to copy the PM code functions to SRAM'.
Thanks,
Jean
Quoted 4 lines
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 16 lines · On Tue, Jan 25, 2011 at 5:48 PM, <[email protected]> wrote:
From: Jean Pihet <[email protected]>
Fix a potential problem with function types when calling the fncpy API to copy the PM code functions to SRAM.
Signed-off-by Jean Pihet <[email protected]>---
arch/arm/plat-omap/include/plat/sram.h | 4 ++--1 files changed, 2 insertions(+), 2 deletions(-)arch/arm/plat-omap/include/plat/sram.h +0
-0@@ -18,10 +18,10 @@ extern void *omap_sram_push_address(unsigned long size);
arch/arm/plat-omap/include/plat/sram.h extern void *omap_sram_push_address(unsigned long size); · line 26
Quoted 10 lines
arch/arm/plat-omap/include/plat/sram.h +2
-2/* Macro to push a function to the internal SRAM, using the fncpy API */ #define omap_sram_push(funcp, size) ({ \ - typeof(&funcp) _res = NULL; \ + typeof(&(funcp)) _res = NULL; \ void *_sram_address = omap_sram_push_address(size); \ if (_sram_address) \ - _res = fncpy(_sram_address, &funcp, size); \ + _res = fncpy(_sram_address, &(funcp), size); \ _res; \ })
I believe this is sound, though I'm not yet in a position to test it fully.
When I have the OMAP kernel building with Thumb-2 again I will follow up.
Cheers
---Dave
Quoted 5 lines
arch/arm/plat-omap/include/plat/sram.h +0
-1--1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Tony Lindgren
Acked-byQuoted 30 lines · Dave Martin
Quoted 16 lines · On Tue, Jan 25, 2011 at 5:48 PM, <[email protected]> wrote:
From: Jean Pihet <[email protected]>
Fix a potential problem with function types when calling the fncpy API to copy the PM code functions to SRAM.
Signed-off-by Jean Pihet <[email protected]>---
arch/arm/plat-omap/include/plat/sram.h | 4 ++--1 files changed, 2 insertions(+), 2 deletions(-)arch/arm/plat-omap/include/plat/sram.h +0
-0@@ -18,10 +18,10 @@ extern void *omap_sram_push_address(unsigned long size);arch/arm/plat-omap/include/plat/sram.h extern void *omap_sram_push_address(unsigned long size); · line 26
Quoted 10 lines
arch/arm/plat-omap/include/plat/sram.h +2
-2/* Macro to push a function to the internal SRAM, using the fncpy API */ #define omap_sram_push(funcp, size) ({ \ - typeof(&funcp) _res = NULL; \ + typeof(&(funcp)) _res = NULL; \ void *_sram_address = omap_sram_push_address(size); \ if (_sram_address) \ - _res = fncpy(_sram_address, &funcp, size); \ + _res = fncpy(_sram_address, &(funcp), size); \ _res; \ })I believe this is sound, though I'm not yet in a position to test it fully.
Quoted 7 lines
When I have the OMAP kernel building with Thumb-2 again I will follow up.
Cheers
---DaveReviewed-by Dave Martin <[email protected]>
Looks good to me too:
I'll add this to omap-testing branch, but as Russell has this queued, you'll have to send this to him on linux-arm-kernel list.
Regards,
Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 37 lines · Tony Lindgren
Quoted 36 lines · Dave Martin
Quoted 16 lines · On Tue, Jan 25, 2011 at 5:48 PM, <[email protected]> wrote:
From: Jean Pihet <[email protected]>
Fix a potential problem with function types when calling the fncpy API to copy the PM code functions to SRAM.
Signed-off-by Jean Pihet <[email protected]>---
arch/arm/plat-omap/include/plat/sram.h | 4 ++--1 files changed, 2 insertions(+), 2 deletions(-)arch/arm/plat-omap/include/plat/sram.h +0
-0@@ -18,10 +18,10 @@ extern void *omap_sram_push_address(unsigned long size);arch/arm/plat-omap/include/plat/sram.h extern void *omap_sram_push_address(unsigned long size); · line 26
Quoted 10 lines
arch/arm/plat-omap/include/plat/sram.h +2
-2/* Macro to push a function to the internal SRAM, using the fncpy API */ #define omap_sram_push(funcp, size) ({ \ - typeof(&funcp) _res = NULL; \ + typeof(&(funcp)) _res = NULL; \ void *_sram_address = omap_sram_push_address(size); \ if (_sram_address) \ - _res = fncpy(_sram_address, &funcp, size); \ + _res = fncpy(_sram_address, &(funcp), size); \ _res; \ })I believe this is sound, though I'm not yet in a position to test it fully.
When I have the OMAP kernel building with Thumb-2 again I will follow up.
Cheers
---Dave
Quoted 5 lines
Quoted 1 line
Reviewed-by Dave Martin <[email protected]>Looks good to me too:
Acked-by Tony Lindgren <[email protected]>
Ok thanks!
Quoted 3 lines
I'll add this to omap-testing branch, but as Russell has this queued, you'll have to send this to him on linux-arm-kernel list.
I have folded the 2 original patches code and acks into '[PATCH] omap:
use fncpy to copy the PM code functions to SRAM' and re-sent to l-a-k and l-o MLs.
Also submitted to Russell's patch system.
Quoted 5 lines
Regards,
Tony
Regards,
Jean
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html