Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp736954ybi; Fri, 21 Jun 2019 07:20:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqzJlrjxVB91o9EtNYytUlauo0AvBMscigF4Ozaviz+gR9EDjb68bLdhlPy0ZhvgGHv5P7Hh X-Received: by 2002:a17:90a:aa81:: with SMTP id l1mr6662784pjq.55.1561126818379; Fri, 21 Jun 2019 07:20:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561126818; cv=none; d=google.com; s=arc-20160816; b=I7XnYndVckCcYttqQ3hp9LFv3fUwlkirL8CCNnyRdmOI0MxLkyl7PE7OoRo4EwFpde TkC0p7pOezW4POQQcjAjK9jvpXOolNMhOv2QdHIgSUY1+7f6G5vgSNlrCsZe0ZS6UxII BXW6LiWQPG9vzRxEudxiPZqu7ORY+0UO+lr9UtqASPh0PulUnslwwjSfu0+C7sWMFNSk fZSPqHZ65auhiuauPauptDhhKJe+uFkHWSOl9CFESKJpD0yea6egCDrKWlDW+fRZvfYv Vvpy3s3nrLDCKLbHGFcnMJKjzL49YDpdwgYAFIHlG5JvHZlz8+jbRade7KcVIySxrPH0 sTxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=pTf/Sa1ixsqLz4uhdaEw6Y2x8BcRF1/Lni1ZwjBhazY=; b=oV5dWnZMVF2JodC7A75qKdv1ejZFkT4eFSs2qOZmfldcc7QiweNWRU7y6nZw0nrbQ3 hJ1NwvV6kTdRtcstHmPq975rGekSeTQHhpQbko5Pau4UeicOv831KZ5d8Ap6pUn920oT Q90QrwBNStVaYVHRMLey3rF2RQu2Xjq8V2a2bWilCl535fiiCCJb/rrgEbtl8sz1JgMN elSonxYy/OwOAmnTZrY1bSypSTYBxf4sQZv/c2JHbydL0eAcQQW4gNvBUr402aWgiN7B HnMyqPtWAhnkRA43tscktHS9YsPpKcyLAG6koETuagyIsHG7rkxU6gmCbXXT51D2rc+K JiQQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 18si2644557pgb.104.2019.06.21.07.20.02; Fri, 21 Jun 2019 07:20:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726401AbfFUOTv (ORCPT + 99 others); Fri, 21 Jun 2019 10:19:51 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:18660 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725975AbfFUOTv (ORCPT ); Fri, 21 Jun 2019 10:19:51 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id B337788BF42820C49AE1; Fri, 21 Jun 2019 22:19:45 +0800 (CST) Received: from [127.0.0.1] (10.202.227.238) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.439.0; Fri, 21 Jun 2019 22:19:37 +0800 Subject: Re: [PATCH 2/5] lib: logic_pio: Add logic_pio_unregister_range() To: Bjorn Helgaas References: <1561026716-140537-1-git-send-email-john.garry@huawei.com> <1561026716-140537-3-git-send-email-john.garry@huawei.com> <20190621134955.GD82584@google.com> CC: , , , , , From: John Garry Message-ID: Date: Fri, 21 Jun 2019 15:19:32 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <20190621134955.GD82584@google.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.238] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/06/2019 14:49, Bjorn Helgaas wrote: >> --- a/lib/logic_pio.c >> > +++ b/lib/logic_pio.c >> > @@ -56,7 +56,7 @@ int logic_pio_register_range(struct logic_pio_hwaddr *new_range) >> > /* for MMIO ranges we need to check for overlap */ >> > if (start >= range->hw_start + range->size || >> > end < range->hw_start) { >> > - mmio_sz += range->size; >> > + mmio_sz = range->io_start + range->size; Hi Bjorn, > Should this be renamed to something like "mmio_end"? Computing a > "size" as "start + size" looks wrong at first glance. The code overall > probably makes sense, but maybe breaking this out as a separate "avoid > overlaps" patch that renames "mmio_sz" might make it clearer. I agree with the renaming to "mmio_end". I can split it out into another patch also. Thanks, John > >> > } else { >> > ret = -EFAULT; >> > goto end_register;