From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CEDCC19F2D for ; Sun, 7 Aug 2022 01:58:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 25FE88E0002; Sat, 6 Aug 2022 21:58:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 20EF08E0001; Sat, 6 Aug 2022 21:58:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0FED78E0002; Sat, 6 Aug 2022 21:58:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 00E868E0001 for ; Sat, 6 Aug 2022 21:58:56 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id C17E61C5F40 for ; Sun, 7 Aug 2022 01:58:56 +0000 (UTC) X-FDA: 79771138272.09.2E3FD9A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf05.hostedemail.com (Postfix) with ESMTP id 2CC60100155 for ; Sun, 7 Aug 2022 01:58:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659837535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=SZh/yM6kokaO6+gJeFFxN++jZ3rqj9aWovbwRZ1sZ8g=; b=SWlZ7OTGwbDaYNF1Ni1Zs/lxydkUMxBhHH7YbPLQUeYQ7mYND3WgsVjLPRHwSdumggnsty tLCCMDolO2fELjlyBCHWn+O6KJSv9Kicgb/crCBqNiOujcJOJG1gy2k0GKP1N0Rbj6dqBg m/OhJA0gO1ZNGkqp3PDd7eKl8Us0OUo= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-592-fRPzZ0wWMdqRwTlrV-o6AA-1; Sat, 06 Aug 2022 21:58:52 -0400 X-MC-Unique: fRPzZ0wWMdqRwTlrV-o6AA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BFF6B2800486; Sun, 7 Aug 2022 01:58:51 +0000 (UTC) Received: from localhost (ovpn-12-55.pek2.redhat.com [10.72.12.55]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A39931415116; Sun, 7 Aug 2022 01:58:50 +0000 (UTC) Date: Sun, 7 Aug 2022 09:58:47 +0800 From: Baoquan He To: Alexander Gordeev Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, hch@infradead.org, wangkefeng.wang@huawei.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 01/11] mm/ioremap: change the return value of io[re|un]map_allowed Message-ID: <20220807015847.GC416711@MiWiFi-R3L-srv> References: <20220801144029.57829-1-bhe@redhat.com> <20220801144029.57829-2-bhe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1659837536; a=rsa-sha256; cv=none; b=txiCFnFWLS4JyJU1RmSvlKntBWJSdQb38NKcY73ijSk7F+RLPEYgEx2AGzvQm/atioLsFV 4ASVhJWKs7ejReYbqARwtXweV7BThiGl73BYHo9DfuQ4Tt0WWBZZ8VQrMzLKeoNdLUzMVC t9qARCn3gcXEfHK7HHn1ZMAcT062JXw= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=SWlZ7OTG; spf=pass (imf05.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1659837536; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=SZh/yM6kokaO6+gJeFFxN++jZ3rqj9aWovbwRZ1sZ8g=; b=k8d1ja/bYNARzFOgVkvqbIQ7PuAVxCZTzyWz+hk9PjG6oT3iK99qJgg8WIpnJMZpXBZ2LY X8OCLAmm6Q7jGiOyvbbbOVvdJDP7gdXvswpX6pM0svQe64YoaFZWMeuKTymo2YkCPPH8kE KTqflDNElG35LFNbAhRHxyE55gTE/38= X-Rspamd-Server: rspam06 X-Rspam-User: X-Stat-Signature: w81eizawdmqjsdx1wp1ojeoth4hbkukr X-Rspamd-Queue-Id: 2CC60100155 Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=SWlZ7OTG; spf=pass (imf05.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-HE-Tag: 1659837535-64390 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 08/04/22 at 05:42pm, Alexander Gordeev wrote: > On Mon, Aug 01, 2022 at 10:40:19PM +0800, Baoquan He wrote: > > Hi Baoquan, > > > --- a/arch/arm64/mm/ioremap.c > > +++ b/arch/arm64/mm/ioremap.c > > @@ -3,19 +3,20 @@ > > #include > > #include > > > > -bool ioremap_allowed(phys_addr_t phys_addr, size_t size, unsigned long prot) > > +void __iomem *ioremap_allowed(phys_addr_t phys_addr, size_t size, unsigned long prot) > > { > > unsigned long last_addr = phys_addr + size - 1; > > + int ret = -EINVAL; > > If ret variable is really needed? There are two places where -EINVAL need be returned. I can remove variable ret, and return -EINVAL directly if there's concern. Thanks again for looking into this series.