Skip to contentSkip to conversation

ARM:VDSO: use PTR_ERR_OR_ZERO for vma check

PATCH New Mutharaju, Prasanna (P.) 2 participants 3 messages Nov 24, 2015 – Dec 8, 2015 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM:VDSO: use PTR_ERR_OR_ZERO for vma check

From: Prasanna Karthik <[email protected]>

Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

---
 arch/arm/kernel/vdso.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/kernel/vdso.c +1 -1
index 54a5aea..994e971 100644
@@ -224,7 +224,7 @@ static int install_vvar(struct mm_struct *mm, unsigned long addr)
 				       VM_READ | VM_MAYREAD,
 				       &vdso_data_mapping);
 
-	return IS_ERR(vma) ? PTR_ERR(vma) : 0;
+	return PTR_ERR_OR_ZERO(vma);
 }
 
 /* assumes mmap_sem is write-locked */
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 ARM:VDSO: use PTR_ERR_OR_ZERO for vma check

Quoted 14 lines · Prasanna (P.)

From: Prasanna Karthik <[email protected]>

Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

---
 arch/arm/kernel/vdso.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/kernel/vdso.c +0 -0
index 54a5aea..994e971 100644

arch/arm/kernel/vdso.c static int install_vvar(struct mm_struct *mm, unsigned long addr) · line 229

Quoted 7 lines
arch/arm/kernel/vdso.c +1 -1
@@ -224,7 +224,7 @@ static int install_vvar(struct mm_struct *mm, unsigned long addr)
 				       VM_READ | VM_MAYREAD,
 				       &vdso_data_mapping);
 
-	return IS_ERR(vma) ? PTR_ERR(vma) : 0;
+	return PTR_ERR_OR_ZERO(vma);
 }
 

Thanks, I think this is fine, but I won't be able to properly process this until next week.

#2 lore raw

PATCH 1/1 ARM:VDSO: use PTR_ERR_OR_ZERO for vma check

Quoted 18 lines · Nathan Lynch
Quoted 17 lines · Prasanna (P.)

From: Prasanna Karthik <[email protected]>

Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

---
 arch/arm/kernel/vdso.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/kernel/vdso.c +0 -0
index 54a5aea..994e971 100644
@@ -224,7 +224,7 @@ static int install_vvar(struct mm_struct *mm, unsigned long addr)
 				       VM_READ | VM_MAYREAD,
 				       &vdso_data_mapping);
 
Quoted 7 lines

arch/arm/kernel/vdso.c static int install_vvar(struct mm_struct *mm, unsigned long addr) · line 229

Quoted 4 lines
arch/arm/kernel/vdso.c +1 -1
-	return IS_ERR(vma) ? PTR_ERR(vma) : 0;
+	return PTR_ERR_OR_ZERO(vma);
 }
 

Thanks, I think this is fine, but I won't be able to properly process this until next week.

I've verified that this results in no change in generated code, and I have sent it to Russell to queue for 4.5, thanks.