From nobody Thu Jan 1 09:34:39 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F188C07545 for ; Tue, 24 Oct 2023 13:49:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343711AbjJXNtE (ORCPT ); Tue, 24 Oct 2023 09:49:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234836AbjJXNsW (ORCPT ); Tue, 24 Oct 2023 09:48:22 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCEC319A9 for ; Tue, 24 Oct 2023 06:47:20 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-d9a45e7e0f9so5267412276.0 for ; Tue, 24 Oct 2023 06:47:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698155239; x=1698760039; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=rU55lfnTUKEjh0uwdJqAIgtITtAkLPiyFECJvQc6NhE=; b=nbDlV8Y/yY4oxlo0eqMWKcefgJkynY2/WjGgcqmlte9eLMHpMSV/eCGMXfrGi/cxxv GJHni5MstsAhASOzKmvX4BetClQypEPzSicOu1Gi+jHMcwz6tJCgGzn9hVdYV5X4hGGx M/zuVcOF0ESVjK2ymtqUUFVS8qHC4L0d8gqvPn2gENg1cwKgqBIVrUmvrPU1MJXklk3U sje3q1sWT7iHUV8yxmQDBO5gIQCgexAE/riWoLmVVxwihLt6FQhGsYhXUIkxHXjr5Gab eKjpdMBOAl1GZr87cU7CJiIR874JEFNNQGNIQJhCyKYHZjAzLMGDHM93d83Dd1V37z0p 3B4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698155239; x=1698760039; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rU55lfnTUKEjh0uwdJqAIgtITtAkLPiyFECJvQc6NhE=; b=Hb0tUx/B63EKf+6cdQVDBuzc3pAih8i3Q+j7eofmVlij4dd3j6Ea75O9Nacoxeo001 4dfs9ppveN7jjcZRN/rxlB3mQg5i9z6FL7/gN/JP6VFmvQVAMQLAkNgscjrXByOHTn7o 4CtZ8qO2Va4nElXDFO5IDUnEVG8DW27jcu3+esduSu0Ct/6JbnUSaofldvS9sp7JMN83 RdabsxQ1yctCcDAUP8NXhsJ+VVx6tNlSpivagXBKtTSQnEZ9boU1AqgGN+cm9PkKFFlC pz6Dm/M52zjq+fDsox6h78C/Czyzhfb2JUh1iH/0fMmKVcbhBwbJPc/dODoS/8kHKkdh wKsA== X-Gm-Message-State: AOJu0Yyf53DJ8auqiHONJmrNSabyx/4dFTHVf73aqimaySqaCX5TrLIO MuvklOlgRkH8TkpFIkxvwwyTJ1JWIMs= X-Google-Smtp-Source: AGHT+IGatz5ZTD8qO9Tv0HGrMDj6Iuk2tgVA4F+Z2fO2W9B6yDgy8GrA8nufWNVDJbI0uZZFq7uH9sjFSH4= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:45ba:3318:d7a5:336a]) (user=surenb job=sendgmr) by 2002:a05:6902:105:b0:da0:3da9:ce08 with SMTP id o5-20020a056902010500b00da03da9ce08mr35563ybh.10.1698155239301; Tue, 24 Oct 2023 06:47:19 -0700 (PDT) Date: Tue, 24 Oct 2023 06:46:14 -0700 In-Reply-To: <20231024134637.3120277-1-surenb@google.com> Mime-Version: 1.0 References: <20231024134637.3120277-1-surenb@google.com> X-Mailer: git-send-email 2.42.0.758.gaed0368e0e-goog Message-ID: <20231024134637.3120277-18-surenb@google.com> Subject: [PATCH v2 17/39] change alloc_pages name in dma_map_ops to avoid name conflicts From: Suren Baghdasaryan To: akpm@linux-foundation.org Cc: kent.overstreet@linux.dev, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, roman.gushchin@linux.dev, mgorman@suse.de, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, corbet@lwn.net, void@manifault.com, peterz@infradead.org, juri.lelli@redhat.com, ldufour@linux.ibm.com, catalin.marinas@arm.com, will@kernel.org, arnd@arndb.de, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, peterx@redhat.com, david@redhat.com, axboe@kernel.dk, mcgrof@kernel.org, masahiroy@kernel.org, nathan@kernel.org, dennis@kernel.org, tj@kernel.org, muchun.song@linux.dev, rppt@kernel.org, paulmck@kernel.org, pasha.tatashin@soleen.com, yosryahmed@google.com, yuzhao@google.com, dhowells@redhat.com, hughd@google.com, andreyknvl@gmail.com, keescook@chromium.org, ndesaulniers@google.com, vvvvvv@google.com, gregkh@linuxfoundation.org, ebiggers@google.com, ytcoode@gmail.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com, vschneid@redhat.com, cl@linux.com, penberg@kernel.org, iamjoonsoo.kim@lge.com, 42.hyeyoo@gmail.com, glider@google.com, elver@google.com, dvyukov@google.com, shakeelb@google.com, songmuchun@bytedance.com, jbaron@akamai.com, rientjes@google.com, minchan@google.com, kaleshsingh@google.com, surenb@google.com, kernel-team@android.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, kasan-dev@googlegroups.com, cgroups@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" After redefining alloc_pages, all uses of that name are being replaced. Change the conflicting names to prevent preprocessor from replacing them when it's not intended. Signed-off-by: Suren Baghdasaryan --- arch/x86/kernel/amd_gart_64.c | 2 +- drivers/iommu/dma-iommu.c | 2 +- drivers/xen/grant-dma-ops.c | 2 +- drivers/xen/swiotlb-xen.c | 2 +- include/linux/dma-map-ops.h | 2 +- kernel/dma/mapping.c | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/x86/kernel/amd_gart_64.c b/arch/x86/kernel/amd_gart_64.c index 56a917df410d..842a0ec5eaa9 100644 --- a/arch/x86/kernel/amd_gart_64.c +++ b/arch/x86/kernel/amd_gart_64.c @@ -676,7 +676,7 @@ static const struct dma_map_ops gart_dma_ops =3D { .get_sgtable =3D dma_common_get_sgtable, .dma_supported =3D dma_direct_supported, .get_required_mask =3D dma_direct_get_required_mask, - .alloc_pages =3D dma_direct_alloc_pages, + .alloc_pages_op =3D dma_direct_alloc_pages, .free_pages =3D dma_direct_free_pages, }; =20 diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index 4b1a88f514c9..28b7b2d10655 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu/dma-iommu.c @@ -1603,7 +1603,7 @@ static const struct dma_map_ops iommu_dma_ops =3D { .flags =3D DMA_F_PCI_P2PDMA_SUPPORTED, .alloc =3D iommu_dma_alloc, .free =3D iommu_dma_free, - .alloc_pages =3D dma_common_alloc_pages, + .alloc_pages_op =3D dma_common_alloc_pages, .free_pages =3D dma_common_free_pages, .alloc_noncontiguous =3D iommu_dma_alloc_noncontiguous, .free_noncontiguous =3D iommu_dma_free_noncontiguous, diff --git a/drivers/xen/grant-dma-ops.c b/drivers/xen/grant-dma-ops.c index 76f6f26265a3..29257d2639db 100644 --- a/drivers/xen/grant-dma-ops.c +++ b/drivers/xen/grant-dma-ops.c @@ -282,7 +282,7 @@ static int xen_grant_dma_supported(struct device *dev, = u64 mask) static const struct dma_map_ops xen_grant_dma_ops =3D { .alloc =3D xen_grant_dma_alloc, .free =3D xen_grant_dma_free, - .alloc_pages =3D xen_grant_dma_alloc_pages, + .alloc_pages_op =3D xen_grant_dma_alloc_pages, .free_pages =3D xen_grant_dma_free_pages, .mmap =3D dma_common_mmap, .get_sgtable =3D dma_common_get_sgtable, diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index 946bd56f0ac5..4f1e3f1fc44e 100644 --- a/drivers/xen/swiotlb-xen.c +++ b/drivers/xen/swiotlb-xen.c @@ -403,6 +403,6 @@ const struct dma_map_ops xen_swiotlb_dma_ops =3D { .dma_supported =3D xen_swiotlb_dma_supported, .mmap =3D dma_common_mmap, .get_sgtable =3D dma_common_get_sgtable, - .alloc_pages =3D dma_common_alloc_pages, + .alloc_pages_op =3D dma_common_alloc_pages, .free_pages =3D dma_common_free_pages, }; diff --git a/include/linux/dma-map-ops.h b/include/linux/dma-map-ops.h index f2fc203fb8a1..3a8a015fdd2e 100644 --- a/include/linux/dma-map-ops.h +++ b/include/linux/dma-map-ops.h @@ -28,7 +28,7 @@ struct dma_map_ops { unsigned long attrs); void (*free)(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle, unsigned long attrs); - struct page *(*alloc_pages)(struct device *dev, size_t size, + struct page *(*alloc_pages_op)(struct device *dev, size_t size, dma_addr_t *dma_handle, enum dma_data_direction dir, gfp_t gfp); void (*free_pages)(struct device *dev, size_t size, struct page *vaddr, diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c index e323ca48f7f2..58e490e2cfb4 100644 --- a/kernel/dma/mapping.c +++ b/kernel/dma/mapping.c @@ -570,9 +570,9 @@ static struct page *__dma_alloc_pages(struct device *de= v, size_t size, size =3D PAGE_ALIGN(size); if (dma_alloc_direct(dev, ops)) return dma_direct_alloc_pages(dev, size, dma_handle, dir, gfp); - if (!ops->alloc_pages) + if (!ops->alloc_pages_op) return NULL; - return ops->alloc_pages(dev, size, dma_handle, dir, gfp); + return ops->alloc_pages_op(dev, size, dma_handle, dir, gfp); } =20 struct page *dma_alloc_pages(struct device *dev, size_t size, --=20 2.42.0.758.gaed0368e0e-goog