Skip to contentSkip to conversation

powerpc/4xx/ocm: fix compilation error

PATCH Applied Christian Lamparter 3 participants 3 messages Dec 22, 2018 – Jan 2, 2019 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 powerpc/4xx/ocm: fix compilation error

This patch fixes a recent compilation regression in ocm:

| ocm.c: In function ‘ocm_init_node’:
| ocm.c:182:18: error: invalid operands to binary |
|       (have ‘int’ and ‘pgprot_t’ {aka ‘struct <anonymous>’})
|       _PAGE_EXEC | PAGE_KERNEL_NCG);
|                  ^
|
| ocm.c:197:17: error: invalid operands to binary |
|       (have ‘int’ and ‘pgprot_t’ {aka ‘struct <anonymous>’})
|        _PAGE_EXEC | PAGE_KERNEL);
|                   ^
Fixes 56f3c1413f5c ("powerpc/mm: properly set PAGE_KERNEL flags in ioremap()")
---
 arch/powerpc/platforms/4xx/ocm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/platforms/4xx/ocm.c +2 -2
index 561b09de69bf..de3565353153 100644
@@ -179,7 +179,7 @@ static void __init ocm_init_node(int count, struct device_node *node)
 	/* ioremap the non-cached region */
 	if (ocm->nc.memtotal) {
 		ocm->nc.virt = __ioremap(ocm->nc.phys, ocm->nc.memtotal,
-					 _PAGE_EXEC | PAGE_KERNEL_NCG);
+			_PAGE_EXEC | pgprot_val(PAGE_KERNEL_NCG));
 
 		if (!ocm->nc.virt) {
 			printk(KERN_ERR
@@ -194,7 +194,7 @@ static void __init ocm_init_node(int count, struct device_node *node)
 
 	if (ocm->c.memtotal) {
 		ocm->c.virt = __ioremap(ocm->c.phys, ocm->c.memtotal,
-					_PAGE_EXEC | PAGE_KERNEL);
+					_PAGE_EXEC | pgprot_val(PAGE_KERNEL));
 
 		if (!ocm->c.virt) {
 			printk(KERN_ERR
Signature · 1 line
2.20.1
Reviewed-by on v2 1/1
#1 lore raw

Le 22/12/2018 à 15:35, Christian Lamparter a écrit :

Quoted 13 lines

This patch fixes a recent compilation regression in ocm:

| ocm.c: In function ‘ocm_init_node’:
| ocm.c:182:18: error: invalid operands to binary |
|       (have ‘int’ and ‘pgprot_t’ {aka ‘struct <anonymous>’})
|       _PAGE_EXEC | PAGE_KERNEL_NCG);
|                  ^
|
| ocm.c:197:17: error: invalid operands to binary |
|       (have ‘int’ and ‘pgprot_t’ {aka ‘struct <anonymous>’})
|        _PAGE_EXEC | PAGE_KERNEL);
|                   ^
Quoted 2 lines
Fixes 56f3c1413f5c ("powerpc/mm: properly set PAGE_KERNEL flags in ioremap()")
Quoted 19 lines
---
  arch/powerpc/platforms/4xx/ocm.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/platforms/4xx/ocm.c +1 -1
index 561b09de69bf..de3565353153 100644
@@ -179,7 +179,7 @@ static void __init ocm_init_node(int count, struct device_node *node)
  	/* ioremap the non-cached region */
  	if (ocm->nc.memtotal) {
  		ocm->nc.virt = __ioremap(ocm->nc.phys, ocm->nc.memtotal,
-					 _PAGE_EXEC | PAGE_KERNEL_NCG);
+			_PAGE_EXEC | pgprot_val(PAGE_KERNEL_NCG));
 
  		if (!ocm->nc.virt) {
  			printk(KERN_ERR

arch/powerpc/platforms/4xx/ocm.c static void __init ocm_init_node(int count, struct device_node *node) · line 200

Quoted 8 lines
arch/powerpc/platforms/4xx/ocm.c +1 -1
@@ -194,7 +194,7 @@ static void __init ocm_init_node(int count, struct device_node *node)
 
  	if (ocm->c.memtotal) {
  		ocm->c.virt = __ioremap(ocm->c.phys, ocm->c.memtotal,
-					_PAGE_EXEC | PAGE_KERNEL);
+					_PAGE_EXEC | pgprot_val(PAGE_KERNEL));
 
  		if (!ocm->c.virt) {
  			printk(KERN_ERR

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

#2 lore raw
In reply to Christian Lamparter
Quoted 13 lines · Christian Lamparter

This patch fixes a recent compilation regression in ocm:

| ocm.c: In function ‘ocm_init_node’:
| ocm.c:182:18: error: invalid operands to binary |
|       (have ‘int’ and ‘pgprot_t’ {aka ‘struct <anonymous>’})
|       _PAGE_EXEC | PAGE_KERNEL_NCG);
|                  ^
|
| ocm.c:197:17: error: invalid operands to binary |
|       (have ‘int’ and ‘pgprot_t’ {aka ‘struct <anonymous>’})
|        _PAGE_EXEC | PAGE_KERNEL);
|                   ^
Quoted 3 lines
Fixes 56f3c1413f5c ("powerpc/mm: properly set PAGE_KERNEL flags in ioremap()")

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/d0757237d7b18b1ce74293be7c077d

cheers