Re: [PATCH 2/2] x86/mm: Fix sparse warnings in untagged_ptr()
From: Andy Shevchenko
Date: Thu Nov 24 2022 - 14:36:19 EST
On Wed, Nov 16, 2022 at 03:43:53AM +0300, Kirill A. Shutemov wrote:
> Linear Address Masking patchset triggered a lot of sparse warnings.
>
> The root cause is that casting pointer to '__typeof__(*(ptr)) *' will
> strip all sparse tags. The type has to be defined based on the pointer
> type, not based on what the pointer points to.
>
> Fix cast in untagged_ptr() and avoid __typeof__() usage in
> get/put_user().
Without this patch we have
drivers/auxdisplay/charlcd.c:482:21: warning: incorrect type in assignment (different address spaces)
drivers/auxdisplay/charlcd.c:482:21: expected char const [noderef] __user *__ptr_clean
drivers/auxdisplay/charlcd.c:482:21: got char const *
So,
Tested-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Can we have this series applied, please?
--
With Best Regards,
Andy Shevchenko