RE: [PATCH v2 5/7] ACPI / x86: introduce acpi_os_readable() support
From: Chen, Yu C
Date: Tue Nov 10 2015 - 08:56:59 EST
Hi, Shevchenko,
Thanks for you review
> -----Original Message-----
> From: Andy Shevchenko [mailto:andy.shevchenko@xxxxxxxxx]
> Sent: Tuesday, November 10, 2015 9:04 PM
> To: Chen, Yu C
> Cc: Zheng, Lv; Lv Zheng; linux-kernel@xxxxxxxxxxxxxxx; linux-
> acpi@xxxxxxxxxxxxxxx; Wysocki, Rafael J; Brown, Len
> Subject: Re: [PATCH v2 5/7] ACPI / x86: introduce acpi_os_readable() support
>
> On Tue, Nov 10, 2015 at 11:42 AM, Chen, Yu C <yu.c.chen@xxxxxxxxx> wrote:
> > Hi, Lv
> > Sorry for my late feedback on the patch, one minor nit below:
>
> >> + start_pfn = page_to_pfn(virt_to_page(pointer));
> >> + end_pfn = page_to_pfn(virt_to_page(pointer + length));
> > Convert pointer to char* first?
> > end_pfn = page_to_pfn(virt_to_page((char*)pointer + length));
>
> Why do you need that?
> void * + size_t = char * + size_t
>
Hum, I was under impression it was a pointer, so I converted it to char* for safety,
but it seems a wrong impression,and I've just tested it on gcc, it is OK without
char*.
> --
> With Best Regards,
> Andy Shevchenko