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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F19D2C433EF for ; Mon, 6 Jun 2022 07:55:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FcN0fYxXKVC/0rz0pOD3LVsM8n//9Dk3/EsMgZ7y4J4=; b=MFFh5S+iOX9QHM B8/4Ur85eZ+D4Hw81Bs5dpS0lBme+z4IlOdrrLidX0VdkWuXTJGegRdbK0XMJY7e+WaVoFZUqrtAF IYTwAaJmmM+hxCU1pmUQkU0vOjECGvWuv6T6Qyf0R7pD58CcuEHeJ4bdM8qdi5Lrzr3ed/PB7rOKD 8rMbZQJtuKPn/uVTGGXfTdGP/UliazY1iAunfWZVlDGMAGF+n6in5EhSA+jSZoG1v3K36bLRN0qfj I4CCWGOca08kxcqR35nZnB/DbeNt3/UZqdbvWEidtXdQARZM4Kv3jVAQIR/pDDuHJOkAikuRLnbAs EhokvttlpbDsHyod/eGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ny7Yx-0000gX-Lx; Mon, 06 Jun 2022 07:54:11 +0000 Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1ny7Yv-0000fB-68; Mon, 06 Jun 2022 07:54:09 +0000 Date: Mon, 6 Jun 2022 00:54:09 -0700 From: Christoph Hellwig To: Kefeng Wang Cc: catalin.marinas@arm.com, will@kernel.org, akpm@linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, hch@infradead.org, arnd@arndb.de, anshuman.khandual@arm.com Subject: Re: [PATCH v4 5/6] arm64: mm: Convert to GENERIC_IOREMAP Message-ID: References: <20220606074815.139265-1-wangkefeng.wang@huawei.com> <20220606074815.139265-6-wangkefeng.wang@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220606074815.139265-6-wangkefeng.wang@huawei.com> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org > +#define ioremap_wc(addr, size) ioremap_prot((addr), (size), PROT_NORMAL_NC) > +#define ioremap_np(addr, size) ioremap_prot((addr), (size), PROT_DEVICE_nGnRnE) Please avoid the overly long lines here. Independt of that having a non-trivial body on a separate line tends to generlly be a lot more readable anyway. > +#define ioremap_cache(addr, size) ({ \ > + pfn_is_map_memory(__phys_to_pfn(addr)) ? \ > + (void __iomem *)__phys_to_virt(addr) : ioremap_prot(addr, size, PROT_NORMAL); \ > +}) And this really should be an inline function. > +int iounmap_allowed(void __iomem *addr) > { > /* > * We could get an address outside vmalloc range in case > * of ioremap_cache() reusing a RAM mapping. > */ > + return is_vmalloc_addr(addr) ? 0 : -EINVAL; As the generic ioremap only returns vmalloc addresses, this check really should go into common code. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel