[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <x49y4dekspp.fsf@segfault.boston.devel.redhat.com>
Date: Tue, 01 Dec 2015 12:02:26 -0500
From: Jeff Moyer <jmoyer@...hat.com>
To: Dan Williams <dan.j.williams@...el.com>
Cc: Borislav Petkov <bp@...en8.de>, Tony Luck <tony.luck@...el.com>,
Linux ACPI <linux-acpi@...r.kernel.org>,
"linux-nvdimm\@lists.01.org" <linux-nvdimm@...1.01.org>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
"linux-kernel\@vger.kernel.org" <linux-kernel@...r.kernel.org>,
Linux MM <linux-mm@...ck.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v3 1/3] resource: Add @flags to region_intersects()
Dan Williams <dan.j.williams@...el.com> writes:
>>> @@ -57,7 +57,7 @@ static void *try_ram_remap(resource_size_t offset, size_t size)
>>> */
>>> void *memremap(resource_size_t offset, size_t size, unsigned long flags)
>>> {
>>> - int is_ram = region_intersects(offset, size, "System RAM");
>>
>> Ok, question: why do those resource things types gets identified with
>> a string?! We have here "System RAM" and next patch adds "Persistent
>> Memory".
>>
>> And "persistent memory" or "System RaM" won't work and this is just
>> silly.
>>
>> Couldn't struct resource have gained some typedef flags instead which we
>> can much easily test? Using the strings looks really yucky.
>>
>
> At least in the case of region_intersects() I was just following
> existing strcmp() convention from walk_system_ram_range.
...which is done in the page fault path. I agree with the suggestion to
get strcmp out of that path.
-Jeff
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists