From e096145ac3a3a823e735b4a8d9633b70d1de29ee Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 25 Jan 2023 14:19:33 +0000 Subject: [PATCH] ANDROID: mm: page_pinner: ensure do_div() arguments matches with respect to type Fixes the following compiler warnings: mm/page_pinner.c:240:28: error: comparison of distinct pointer types ('typeof ((ts_usec)) *' (aka 'long long *') and 'uint64_t *' (aka 'unsigned long long *')) [-Werror,-Wcompare-distinct-pointer-types] unsigned long rem_usec = do_div(ts_usec, 1000000); ^~~~~~~~~~~~~~~~~~~~~~~~ include/asm-generic/div64.h:226:28: note: expanded from macro 'do_div' (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \ ~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~ mm/page_pinner.c:312:13: error: comparison of distinct pointer types ('typeof ((ts_usec)) *' (aka 'long long *') and 'uint64_t *' (aka 'unsigned long long *')) [-Werror,-Wcompare-distinct-pointer-types] rem_usec = do_div(ts_usec, 1000000); ^~~~~~~~~~~~~~~~~~~~~~~~ include/asm-generic/div64.h:226:28: note: expanded from macro 'do_div' (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \ ~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~ Bug: 261962742 Signed-off-by: Lee Jones Change-Id: I63bc6e2d82bfd757c4bf9df53a1a17a1a6235ba7 --- mm/page_pinner.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/page_pinner.c b/mm/page_pinner.c index 6a825777afac..a444584103ad 100644 --- a/mm/page_pinner.c +++ b/mm/page_pinner.c @@ -236,7 +236,7 @@ print_page_pinner(bool longterm, char __user *buf, size_t count, struct captured ret = snprintf(kbuf, count, "Page pinned for %lld us\n", record->elapsed); } else { - s64 ts_usec = record->ts_usec; + u64 ts_usec = record->ts_usec; unsigned long rem_usec = do_div(ts_usec, 1000000); ret = snprintf(kbuf, count, @@ -291,7 +291,7 @@ void __dump_page_pinner(struct page *page) unsigned long pfn; int count; unsigned long rem_usec; - s64 ts_usec; + u64 ts_usec; if (unlikely(!page_ext)) { pr_alert("There is not page extension available.\n");