linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] perf/ring_buffer: Modify the parameter type of perf_mmap_free_page()
@ 2019-09-27  8:22 Yunfeng Ye
  2019-09-27  8:24 ` [PATCH 2/2] perf/ring_buffer: Matching the memory allocate and free, in rb_alloc() Yunfeng Ye
  2019-10-14  8:14 ` [PATCH 1/2] perf/ring_buffer: Modify the parameter type of perf_mmap_free_page() Yunfeng Ye
  0 siblings, 2 replies; 6+ messages in thread
From: Yunfeng Ye @ 2019-09-27  8:22 UTC (permalink / raw)
  To: peterz, mingo, acme, mark.rutland, alexander.shishkin, jolsa, namhyung
  Cc: linux-kernel

In perf_mmap_free_page(), the unsigned long type is converted to the
pointer type, but where the call is made, the pointer type is converted
to the unsigned long type. There is no need to do these operations.

Modify the parameter type of perf_mmap_free_page() to pointer type.

Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
---
 kernel/events/ring_buffer.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c
index ffb59a4..abc145c 100644
--- a/kernel/events/ring_buffer.c
+++ b/kernel/events/ring_buffer.c
@@ -799,9 +799,9 @@ struct ring_buffer *rb_alloc(int nr_pages, long watermark, int cpu, int flags)
 	return NULL;
 }

-static void perf_mmap_free_page(unsigned long addr)
+static void perf_mmap_free_page(void *addr)
 {
-	struct page *page = virt_to_page((void *)addr);
+	struct page *page = virt_to_page(addr);

 	page->mapping = NULL;
 	__free_page(page);
@@ -811,9 +811,9 @@ void rb_free(struct ring_buffer *rb)
 {
 	int i;

-	perf_mmap_free_page((unsigned long)rb->user_page);
+	perf_mmap_free_page(rb->user_page);
 	for (i = 0; i < rb->nr_pages; i++)
-		perf_mmap_free_page((unsigned long)rb->data_pages[i]);
+		perf_mmap_free_page(rb->data_pages[i]);
 	kfree(rb);
 }

-- 
2.7.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-10-18 12:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-27  8:22 [PATCH 1/2] perf/ring_buffer: Modify the parameter type of perf_mmap_free_page() Yunfeng Ye
2019-09-27  8:24 ` [PATCH 2/2] perf/ring_buffer: Matching the memory allocate and free, in rb_alloc() Yunfeng Ye
2019-10-14  8:15   ` Yunfeng Ye
2019-10-18 12:48     ` [tip: perf/core] " tip-bot2 for Yunfeng Ye
2019-10-14  8:14 ` [PATCH 1/2] perf/ring_buffer: Modify the parameter type of perf_mmap_free_page() Yunfeng Ye
2019-10-18 12:48   ` [tip: perf/core] " tip-bot2 for Yunfeng Ye

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).