Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp2193630rwb; Thu, 27 Jul 2023 03:44:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlFXH5VhhVqJ+9XcvXY3xopiP4bnLrFQMNFbZoDKF/e7TZYuLx09v5XmG39sW55CtL9yFj14 X-Received: by 2002:a17:90a:c293:b0:263:850a:b49c with SMTP id f19-20020a17090ac29300b00263850ab49cmr4620163pjt.7.1690454652093; Thu, 27 Jul 2023 03:44:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690454652; cv=none; d=google.com; s=arc-20160816; b=C1Hyr/90HCSuYbBff9aq+6LmI5EDosh4osjz1EOr1X7zBLCU/xQeOLnmXrI5EBNj5B HR01iQI2E7HQyk8YA4HM2ANeoE8mUzrs3+DBTANzrU+tdWHIvdM/K51C65XjGnROUvG4 5xbTRE8KGUVT0eSkovUZ9/9j6E+3mCQ13+IA3li8g6qv2IaqE8juc/fdQHKO/33+4fTL CKty2HNq0EVND2v62qA2D7CvvTCsuVIHnRx0jfpBaYo2FQPVIvj/U0hS77Tn7smXtpW1 gmZq61LfI8FqWEqwaHpSSMsr6lno8WfIsv9pnnrNrM242hcBzE+LDAOZp1hdN9k/qmX3 TXkg== 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=57Meadi7QFswEYNF22UlYnn+TVRooVmdRcPd9UdXeaw=; fh=5Ib3WqJ3OZ5XPmLEaC3VlQbuheTcvzReawW7Y71rx2I=; b=Je9C5LeCIXjk4O5TyZExlkZUD2eTiVQtYF6YiFVBSp7mMYxtbqizZZbWob0MKfP6QI 9PdBZ+f/Up45ZBEetCDQzqJ/mKT9Der0UzMtvKEYhIQg1k98hrc07vYCO00VfooM34qQ P9GtMAPkd/MBdMOwptQ7HtO6u0wHoodACkrrf21i8t8Bi1nG8u2u1VRYx11ndsm1oIqO i807gEz88yAnjA3tf5fXVLG+xqgRkDo3bS6KmK3oOAJecTQQi9qXwO1tA7/l5TRxLOJC H/MDS8fEFwEgpUJhVlRtmKa49iB0PViDd8b8VX2AJC2UK/cJlnQtJn69cxUzrwNklRcK /u3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JKvxP6mD; 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 bt1-20020a17090af00100b00267ed8359e2si1175188pjb.55.2023.07.27.03.44.00; Thu, 27 Jul 2023 03:44:12 -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=JKvxP6mD; 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 S233821AbjG0KXu (ORCPT + 99 others); Thu, 27 Jul 2023 06:23:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233836AbjG0KXh (ORCPT ); Thu, 27 Jul 2023 06:23:37 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC4B6271C for ; Thu, 27 Jul 2023 03:22:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690453359; 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=57Meadi7QFswEYNF22UlYnn+TVRooVmdRcPd9UdXeaw=; b=JKvxP6mDdiAAOoCqfBO5pDfdVwaWoeJDebYzsgGGp7A6aKnQDknHtzrTepTp0u4xhHuqSh xiXp4/al8eeZBKmr99ZLpHRexK4Wn3CC9kNeVlJWBoaFu4d+doL+BB46E9K/bPxTN9462o IHEEEn8G6Ac0k+dILnR2uCV4nyyGWB0= Received: from mimecast-mx02.redhat.com (66.187.233.73 [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-79-o4dkN_EZN6CJUT6ZaTBvsA-1; Thu, 27 Jul 2023 06:22:36 -0400 X-MC-Unique: o4dkN_EZN6CJUT6ZaTBvsA-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 0598C3811F34; Thu, 27 Jul 2023 10:22:36 +0000 (UTC) Received: from localhost (unknown [10.72.112.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2B98A140E949; Thu, 27 Jul 2023 10:22:34 +0000 (UTC) Date: Thu, 27 Jul 2023 18:22:31 +0800 From: Baoquan He To: Arnd Bergmann Cc: Andrew Morton , Arnd Bergmann , linux-kernel@vger.kernel.org Subject: Re: [PATCH] iomem: remove __weak ioremap_cache helper Message-ID: References: <20230726145432.1617809-1-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230726145432.1617809-1-arnd@kernel.org> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,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 07/26/23 at 04:54pm, Arnd Bergmann wrote: > From: Arnd Bergmann > > No portable code calls into this function any more, and on > architectures that don't use or define their own, it causes > a warning: > > kernel/iomem.c:10:22: warning: no previous prototype for 'ioremap_cache' [-Wmissing-prototypes] > 10 | __weak void __iomem *ioremap_cache(resource_size_t offset, unsigned long size) > > Fold it into the only caller that uses it on architectures > without the #define. > > Note that the fallback to ioremap is probably still wrong on > those architectures, but this is what it's always done there. > > Signed-off-by: Arnd Bergmann > --- > kernel/iomem.c | 12 ++++-------- > 1 file changed, 4 insertions(+), 8 deletions(-) > > diff --git a/kernel/iomem.c b/kernel/iomem.c > index 9682471e64717..dc2120776e1c3 100644 > --- a/kernel/iomem.c > +++ b/kernel/iomem.c > @@ -5,18 +5,14 @@ > #include > #include > > -#ifndef ioremap_cache > -/* temporary while we convert existing ioremap_cache users to memremap */ > -__weak void __iomem *ioremap_cache(resource_size_t offset, unsigned long size) > -{ > - return ioremap(offset, size); > -} > -#endif > - > #ifndef arch_memremap_wb > static void *arch_memremap_wb(resource_size_t offset, unsigned long size) > { > +#ifdef ioremap_cache > return (__force void *)ioremap_cache(offset, size); > +#else > + return (__force void *)ioremap(offset, size); > +#endif > } > #endif This looks good to me, thanks. Reviewed-by: Baoquan He