Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967078AbcLVW6u (ORCPT ); Thu, 22 Dec 2016 17:58:50 -0500 Received: from mout.gmx.net ([212.227.15.18]:52715 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966119AbcLVW6s (ORCPT ); Thu, 22 Dec 2016 17:58:48 -0500 Subject: Re: Fwd: [PATCH 1/1] of/fdt: failed to mark hotplug range message To: Reza Arbab References: <20161222053405.27190-1-xypron.glpk@gmx.de> <5251e7ef-cadf-7833-9a7e-66ebf78e2e94@gmx.de> <20161222214917.7g6ldgkdvrlqsyq3@arbab-laptop.austin.ibm.com> Cc: Balbir Singh , Rob Herring , Frank Rowand , Andrew Morton , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org From: Heinrich Schuchardt Message-ID: Date: Thu, 22 Dec 2016 23:58:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161222214917.7g6ldgkdvrlqsyq3@arbab-laptop.austin.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:oe0ZC9KQb1t3FyfixaUemaKkR2kji5QsMJHwDNAie+WadlvO9dd R3rUpr5uoAfb8v+54p/4Bkb6fthpvOm9CdL9h5xtNuttuGoDjduMOfyE1caAoKqa3t9xZR1 eBqAwo4sJJeiUKbotwXvMtRaNOafLOu8uz10v60ebBEBbipubluTa1HTtpozzFuQ1MElsjy K2WIUhXj4zQR4okzTRqgQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:N2s1qN6xAFs=:Fw2w1R5yxF16fGWX36i6QS BtbpKPxjEUEoihNgE1BZxR2PyQIU8hTY/lH9XtXZkI88SJy8BqS0dGVmEiM6yAa5E31d8pQYk t1MxnSPiw8X1SgsASBi6W1b1dmCA8zlVXbjcglgsO+K6fOVW+yVMs4zNp6gOCVOj63FROFms1 nK4ZsDcAOxmOllJhTHEpkhtzMLIh4lTBEk1zA9atNI6jTOw7msSiaSIlc5DOuXhv8QGUX/KnM /xWRvOAvdOjDCKprp0MHsglzHvkQNNOPd4feiTI4aNiwdRtC2NWB8ycY5t9rwLsZqOyDFKJ2C u7O95gPTP+fBBKNRy906oc+3O6zOLxnE4PhVgFn0a+H/qniVUMfCiVuGIm/K3zOaeKh0dtjSO 6dwurRkvgsG4Re7SecOjueEUeYCSmxK0i2OTiwBNaikHMP0uLlzw8Bq9PZodEQmK23zQ0Ays0 8K9wLAGe2BnaxPIHq5wtKpn1gQOp98szniMJMD+OJltNu72zwuG03Enuwd9ue1kTowaDzJTSJ Q/YMiNcLi2+YbPKTCp9g8dglM1/YNvU5DFC/EFT6crRG1BmYphcELCGtdNLNLuhuY1ot/bB+N YI3Uw0YI7oIapCISRExjut5e1Ip0V2T0PnPHV8vDw0JMhJQmyLx1l5KSVB9BPicSOpBjSNhvD iJ/bliB53khc/HQhrHTD9dj4Ol2Thf3ozs2FGUei7Cbymgud2QLN08Q3ySnyJZs6CHgMH37JU 4QLOD0AjIoSg0MsWb+Vh/BoQyQkkHm8kRqb5h3EEgVW1/MHhsdU3JbfjIne/do3m8x3lvWqg8 PL+fu4e Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1594 Lines: 48 On 12/22/2016 10:49 PM, Reza Arbab wrote: > On Thu, Dec 22, 2016 at 06:52:45AM +0100, Heinrich Schuchardt wrote: >> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c >> index c9b5cac03b36..fd129b6e5396 100644 >> --- a/drivers/of/fdt.c >> +++ b/drivers/of/fdt.c >> @@ -1057,7 +1057,7 @@ int __init early_init_dt_scan_memory(unsigned >> long node, const char *uname, >> >> if (early_init_dt_mark_hotplug_memory_arch(base, size)) >> pr_warn("failed to mark hotplug range 0x%llx - 0x%llx\n", >> - base, base + size); >> + base, base + size - 1); >> } >> >> return 0; > > Isn't it implied that ranges printed this way are [start, end)? > > If not, the entire file should be fixed, not just this occurrence. > The output in the file drivers/of/fdt.c is currently inconsistent. Alternative output formats are pr_err("Reserved memory not supported, ignoring range %pa - %pa%s\n", &base, &size, nomap ? " (nomap)" : ""); and pr_debug("Reserved memory: reserved region for node '%s': base %pa, size %ld MiB\n", uname, &base, (unsigned long)size / SZ_1M); (Here we will see size = 0 for values less then 1 MiB.) I expect intervals to be closed and not half open if not explicitly indicated otherwise. So I suggest we change all occurrences of interval output in drivers/of/fdt.c to 0xfirstbyte - 0xlastbyte where firstbyte = base and lastbyte = base + size - 1. Using the %pa format code ensures that the length of the output matches the bitness of address pointers in the system. Best regards Heinrich Schuchardt