Skip to contentSkip to conversation

x86, mm: add parenthesis for TLB tracepoint size calculation

PATCH New Dave Hansen 2 participants 2 messages Jul 20, 2015 – Jul 21, 2015

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

PATCH 1/1 x86, mm: add parenthesis for TLB tracepoint size calculation

From: Dave Hansen <[email protected]>

flush_tlb_info->flush_start/end are both normal virtual addresses. When calculating 'nr_pages' (only used for the tracepoint), I neglected to put parenthesis in.

Thanks to David Koufaty for pointing this out.

---

 b/arch/x86/mm/tlb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/mm/tlb.c renamed from arch/x86/mm/tlb.c~tlb-parens +1 -1
diff -puN arch/x86/mm/tlb.c~tlb-parens arch/x86/mm/tlb.c
@@ -117,7 +117,7 @@ static void flush_tlb_func(void *info)
 		} else {
 			unsigned long addr;
 			unsigned long nr_pages =
-				f->flush_end - f->flush_start / PAGE_SIZE;
+				(f->flush_end - f->flush_start) / PAGE_SIZE;
 			addr = f->flush_start;
 			while (addr < f->flush_end) {
 				__flush_tlb_single(addr);

_

#1 lore raw

[tip:x86/urgent] x86/mm: Add parenthesis for TLB tracepoint size calculation

x86/mm: Add parenthesis for TLB tracepoint size calculation
Commit-ID:  bbc03778b9954a2ec93baed63718e4df0192f130
Gitweb:     http://git.kernel.org/tip/bbc03778b9954a2ec93baed63718e4df0192f130
Author:     Dave Hansen <[email protected]>
AuthorDate: Mon, 20 Jul 2015 16:01:53 -0700
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 21 Jul 2015 07:45:50 +0200

x86/mm: Add parenthesis for TLB tracepoint size calculation

flush_tlb_info->flush_start/end are both normal virtual addresses. When calculating 'nr_pages' (only used for the tracepoint), I neglected to put parenthesis in.

Thanks to David Koufaty for pointing this out.

---
 arch/x86/mm/tlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/mm/tlb.c +1 -1
index 3250f23..90b924a 100644
@@ -117,7 +117,7 @@ static void flush_tlb_func(void *info)
 		} else {
 			unsigned long addr;
 			unsigned long nr_pages =
-				f->flush_end - f->flush_start / PAGE_SIZE;
+				(f->flush_end - f->flush_start) / PAGE_SIZE;
 			addr = f->flush_start;
 			while (addr < f->flush_end) {
 				__flush_tlb_single(addr);