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 <joneslee@google.com>
Change-Id: I63bc6e2d82bfd757c4bf9df53a1a17a1a6235ba7
This commit is contained in:
Lee Jones
2023-01-25 14:19:33 +00:00
committed by Treehugger Robot
parent e427004fad
commit e096145ac3

View File

@@ -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");