lkml.org 
[lkml]   [2020]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH V2 2/3] perf/x86/intel/uncore: Record the size of mapped area
From
Date


On 5/28/2020 9:29 AM, Andi Kleen wrote:
> On Thu, May 28, 2020 at 06:15:26AM -0700, kan.liang@linux.intel.com wrote:
>> - box->io_addr = ioremap(addr, SNB_UNCORE_PCI_IMC_MAP_SIZE);
>> + if (!type->mmio_map_size) {
>> + pr_warn("perf uncore: Cannot ioremap for %s. Size of map area is 0.\n",
>> + type->name);
>> + return;
>> + }
>
> Is that likely that the size is 0?

In case someone forgets to set mmio_map_size.

>
> In any case you have to test the return value of ioremap. So I would rather
> test the address for 0 than the size.

The box->io_addr is checked now, but there is no warning message.
I will remove the check for mmio_map_size, and add a warning message for
the check of box->io_addr.

Thanks,
Kan

\
 
 \ /
  Last update: 2020-05-28 15:46    [W:0.040 / U:4.960 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site