Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756147AbbLARCa (ORCPT ); Tue, 1 Dec 2015 12:02:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37184 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751704AbbLARC3 (ORCPT ); Tue, 1 Dec 2015 12:02:29 -0500 From: Jeff Moyer To: Dan Williams Cc: Borislav Petkov , Tony Luck , Linux ACPI , "linux-nvdimm\@lists.01.org" , "Rafael J. Wysocki" , "linux-kernel\@vger.kernel.org" , Linux MM , Andrew Morton Subject: Re: [PATCH v3 1/3] resource: Add @flags to region_intersects() References: <1448404418-28800-1-git-send-email-toshi.kani@hpe.com> <1448404418-28800-2-git-send-email-toshi.kani@hpe.com> <20151201135000.GB4341@pd.tnic> X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 X-PCLoadLetter: What the f**k does that mean? Date: Tue, 01 Dec 2015 12:02:26 -0500 In-Reply-To: (Dan Williams's message of "Tue, 1 Dec 2015 08:54:23 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1171 Lines: 31 Dan Williams 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/