Skip to contentSkip to conversation

misc: aspeed-p2a-ctrl: fix mixed declarations

PATCH In review Patrick Venture 3 participants 3 messages Apr 26, 2019 – May 2, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 misc: aspeed-p2a-ctrl: fix mixed declarations

Fix up mixed declarations and code in aspeed_p2a_mmap.

Tested: Verified the build had the error and that this patch resolved it and there were no other warnings or build errors associated with compilation of this driver.

---
 drivers/misc/aspeed-p2a-ctrl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/misc/aspeed-p2a-ctrl.c +2 -1
index 9736821972ef..b60fbeaffcbd 100644
@@ -100,6 +100,7 @@ static void aspeed_p2a_disable_bridge(struct aspeed_p2a_ctrl *p2a_ctrl)
 static int aspeed_p2a_mmap(struct file *file, struct vm_area_struct *vma)
 {
 	unsigned long vsize;
+	pgprot_t prot;
 	struct aspeed_p2a_user *priv = file->private_data;
 	struct aspeed_p2a_ctrl *ctrl = priv->parent;
 
@@ -107,7 +108,7 @@ static int aspeed_p2a_mmap(struct file *file, struct vm_area_struct *vma)
 		return -EINVAL;
 
 	vsize = vma->vm_end - vma->vm_start;
-	pgprot_t prot = vma->vm_page_prot;
+	prot = vma->vm_page_prot;
 
 	if (vma->vm_pgoff + vsize > ctrl->mem_base + ctrl->mem_size)
 		return -EINVAL;
Signature · 1 line
2.21.0.593.g511ec345e18-goog
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Patrick Venture

Fix up mixed declarations and code in aspeed_p2a_mmap.

Tested: Verified the build had the error and that this patch resolved it and there were no other warnings or build errors associated with compilation of this driver.

Quoted 28 lines
---
 drivers/misc/aspeed-p2a-ctrl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/misc/aspeed-p2a-ctrl.c +2 -2
index 9736821972ef..b60fbeaffcbd 100644
@@ -100,6 +100,7 @@ static void aspeed_p2a_disable_bridge(struct aspeed_p2a_ctrl *p2a_ctrl)
 static int aspeed_p2a_mmap(struct file *file, struct vm_area_struct *vma)
 {
        unsigned long vsize;
+       pgprot_t prot;
        struct aspeed_p2a_user *priv = file->private_data;
        struct aspeed_p2a_ctrl *ctrl = priv->parent;
 
@@ -107,7 +108,7 @@ static int aspeed_p2a_mmap(struct file *file, struct vm_area_struct *vma)
                return -EINVAL;
 
        vsize = vma->vm_end - vma->vm_start;
-       pgprot_t prot = vma->vm_page_prot;
+       prot = vma->vm_page_prot;
 
        if (vma->vm_pgoff + vsize > ctrl->mem_base + ctrl->mem_size)
                return -EINVAL;
--

2.21.0.593.g511ec345e18-goog

Reviewed-by on v1 1/1
#2 lore raw
In reply to Patrick Venture
Quoted 8 lines · Patrick Venture

Fix up mixed declarations and code in aspeed_p2a_mmap.

Tested: Verified the build had the error and that this patch resolved it and there were no other warnings or build errors associated with compilation of this driver.

Quoted 33 lines
---
 drivers/misc/aspeed-p2a-ctrl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/misc/aspeed-p2a-ctrl.c +1 -0
index 9736821972ef..b60fbeaffcbd 100644
@@ -100,6 +100,7 @@ static void aspeed_p2a_disable_bridge(struct 
 aspeed_p2a_ctrl *p2a_ctrl)
 static int aspeed_p2a_mmap(struct file *file, struct vm_area_struct 
 *vma)
 {
 	unsigned long vsize;
+	pgprot_t prot;
 	struct aspeed_p2a_user *priv = file->private_data;
drivers/misc/aspeed-p2a-ctrl.c +1 -1
 	struct aspeed_p2a_ctrl *ctrl = priv->parent;
@@ -107,7 +108,7 @@ static int aspeed_p2a_mmap(struct file *file, 
 struct vm_area_struct *vma)
 		return -EINVAL;
 
 	vsize = vma->vm_end - vma->vm_start;
-	pgprot_t prot = vma->vm_page_prot;
+	prot = vma->vm_page_prot;
 
 	if (vma->vm_pgoff + vsize > ctrl->mem_base + ctrl->mem_size)

return -EINVAL;

Signature · 1 line
2.21.0.593.g511ec345e18-goog