Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp3357964rwb; Sat, 6 Aug 2022 19:48:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR5ypEq9HCfcU7spm2zb8Rflo9lASeDvRGytq/eWFxGbjQ37RIdFIx8tSM3c0tnN/QBC57+T X-Received: by 2002:a17:907:272a:b0:731:4699:b375 with SMTP id d10-20020a170907272a00b007314699b375mr1219152ejl.633.1659840491496; Sat, 06 Aug 2022 19:48:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659840491; cv=none; d=google.com; s=arc-20160816; b=OgbgK7yHcgghDulPqoW9nRXAdEtxJOKgFZHdHybk2Av/Pz7IArmConfnBpL543Hc5j jkNf3F0SULqa5mHxVA+CnbPaoS2dDH3vfb0l7jrw/V4MllYjhQa8Copx5UvKQTz1+tJF AOcSZaN6/MSaOvqnL86JTJq9+gxTu28HVaoD3d1OwcWtq7WHPB0jyFvEA+CVooK3wR4n abOu/jb9OLRasvG9xgSf/Ud2oHCQP5lxxKlFJirGm3WWaKvfHxBW3Gf/hU63iSkTf3pp F6uACCfhpjLHDyyWajReNaPoEkRQDltD63igMh9lKRmgPPFVrwoxd+WeHzSodKYEA4DB 0gJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=SZh/yM6kokaO6+gJeFFxN++jZ3rqj9aWovbwRZ1sZ8g=; b=0QulC0D0QQLu5jy8zCkXTCkkYpelf5x/f4uxq12yPOBgqWR5vsUQUmYZVKeZk6y2Qt m/P1yW8Oo6zpWQteLVMaKy05j2GuufR2PSYC6AIOieR5X1XbH41+lcqN9A1bu7AeS35d taKJk/oNhZpegJZ4DNL0COBq0uRutNDCmvjs7qeZltUa73Ut0h2qE6DGEtmGUu1j5vLW pO1FLkXm2c46lelsSx2ORoXFM4fcnceCUsEVAFj1kNDCEXQAJpntMHCyISEYcDg2Zfb3 VDgtyjpJye6R4hFovdHmi8wVFJVu2UtS8gkEYET+bXh1aQX7NF5yjK81OBtgAp+lapA+ XDnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NDP9PnPf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dt2-20020a170907728200b00722dcbe685bsi7252888ejc.218.2022.08.06.19.47.40; Sat, 06 Aug 2022 19:48:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NDP9PnPf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234238AbiHGB64 (ORCPT + 99 others); Sat, 6 Aug 2022 21:58:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231978AbiHGB6z (ORCPT ); Sat, 6 Aug 2022 21:58:55 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8009AE00A for ; Sat, 6 Aug 2022 18:58:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659837533; 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=NDP9PnPf084Yg7Xc7LWhI07L0NV5gjgHP2m4DgE96mm/s5J2YZjpDuDdEjHVvgdNA5DGCv asVkQ8TTIW1LT5EJa8gKXxUogQEWQ3qWCl5gQbFlGtwsLK27OQau0UulYg7vI63nkioh/T 6IwoKqlptyo+auss3Y+fwvZ6uxqs2mU= 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 X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.