From patchwork Tue Feb 6 04:15:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 13546619 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 CD020C4828D for ; Tue, 6 Feb 2024 04:15:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1ADA76B0071; Mon, 5 Feb 2024 23:15:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 15DAD6B0072; Mon, 5 Feb 2024 23:15:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 04C276B0074; Mon, 5 Feb 2024 23:15:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id EAFDC6B0071 for ; Mon, 5 Feb 2024 23:15:31 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id AFCBDA165E for ; Tue, 6 Feb 2024 04:15:31 +0000 (UTC) X-FDA: 81760064862.25.44DE138 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf07.hostedemail.com (Postfix) with ESMTP id B726A4001C for ; Tue, 6 Feb 2024 04:15:28 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf07.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707192929; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=Qpg2M1ys7m9eyeO0UXQxStNIQZV72frkHH/ikrNRvJw=; b=NtTN4C+fsTHYG+ocWHuG5TVtMtt7Ze6HSkPAYi5KSGHglRl9yveMow9Ohyc8A1DAptQhVi G3pRKHGxDSlKmg6jGR3NgUSQrTg7tPahGbpcoc6Y+1HnQ8IVIYygopPWrmrBxxZ9vZrgnj ZO7lfwbxQcH5+TMW6obaGMI3FTT04aM= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf07.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707192929; a=rsa-sha256; cv=none; b=WJyMl4b0Eo8dlZMiCMwmXgoXEumFypd0P5Y0NwhIORIa6524XDyQSf+g1kkFvMc8rarjyt Cg5F57g8E9jMJSsaV661AtXvU0BPF7cJt35RaDpwcKer5lMJb9d1TM4wOqkj270v11cw86 jmRE6KNwwUprcI9dlkCmuLawIDMalzE= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3CB3612FC; Mon, 5 Feb 2024 20:16:10 -0800 (PST) Received: from a077893.arm.com (unknown [10.163.42.38]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id E71473F762; Mon, 5 Feb 2024 20:15:24 -0800 (PST) From: Anshuman Khandual To: linux-mm@kvack.org Cc: Anshuman Khandual , Sumit Semwal , Andrew Morton , dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm/cma: Drop cma_get_name() Date: Tue, 6 Feb 2024 09:45:18 +0530 Message-Id: <20240206041518.438801-1-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: B726A4001C X-Stat-Signature: ap6m4xgxp3jy3jp1ukhoujk6o7yybj1r X-HE-Tag: 1707192928-810725 X-HE-Meta: U2FsdGVkX1/FwnEtp/1Vu+ph4cvxXE54r7macQyDgYLoo5X0XSTwztD396pZVC3/7j7g4k8sZ6EyFNPiUYLOtdfwFW1m22qgPqNsbcavRNoC1+UUbJsOtzN4VpDtoE1ik1hLpc7JAcryxxQHSD+ECWQpqXnKNiP+7VFnhGQZCJ1zUzj7V4+MKFY7iDMcwTR72xZwZ1maZTHhIKJ3joMIr4Iuxd8kZLQ07s9+3UqcM5mHjVz5YLbvKTO6IC8Yh3Jw6dDQmFhpSw+tTRwjavu05OLrMFVnx7QsD/tZgQmgPWJKtEx0fDYJUNExGg+6UPagWzL4QncdUu+IneQe+xN1Pw2V738+GTTdtRoEQcfiAiE+C2Z7uHcLX8TaVP6tnk4YBufS4CX6Nu63aeCpuXkIf1y2IiJ83gt7Tp/E2NTPSQRktvwfhiZKxHes6uLwjCbpqgSYyPkpHBEyoj7y7wvFk6ybGoDxHgCRscNkH6k2RI6Gimd0UJJ/tt2IF+18biW5ZijUTyhesmNP6I9X2s2uuohf+6A0DJorvdjJ4LuTaB+KegwS94REk5sPuLz2yT5NzeqsV1JFxMnkH/J0lbqQzV7qnQ4prLmX119hOcviKDot3Fn7xVJ8yhMVJnBf3jIhNBl2wxIWk3NTngEW+2LcjCWZYDoODPBUJ2WSi7iDA9fay9p6I5xB3EmqLTdLcT9uRr+LgsroJFC4115j2EPks28HOsQvENKoHyeU85+EVc1USwoot1LoRJ5amyKfMczTCrWO5TiaAtQJiihNcY7iM3BCWIV3xxqIahs4IOtJGOX4E/OE+CIY0YkJqKx+g488L1Ibhqm+nbf+qM6h+LEXfi0AfO6uHKpFNGAgxmUz5YclsohdN7XfLIQ++VWAnnRUsmqce9uTYpjO2BK/euCSkbyIYRYEffAKrqJaJImcrREdqJN+PbiSe5R5KGNFizMEHpV9BAmSfPrVOOpvld4 cS8X2QGW 1C0nA1UjkXClWdSPNe3dFzCil8cDS2Q7bR7ze3g6lv8FIhJtp3ahfbtfNpZyvvoQyNMZAx/WiF36m+zr/fiu8OMmGYOkZLIontuW3zZgHuFfU62qR5hijPXugAENLjgM87gdfsQ8AyhPEYgaVbNMpdhGoiGkd0VLM59g5tNAwell3pajtPvX0wzv/8m0BkwrX2DufqLpJU6XUk87hLKLc7cwTNFXmhgd1wNVmFMPfEBFqITw1m1e3H5RK+EkoD+KR4Fe57L8kFHM+fK5NGkYdHjk40tA8/XGqrtDd3CoVqPBZr6dDlQ1z5GmwkFaTSgRmZQ9iPwMssPtI78ZIselfFZ1sZS/C9X6H/tGrr2qVd2wNp0ItU14wLRxMXgzgU4R7Ja7UeW6nKA4rPlXrM4TzrkjoEq7xnLR0g+ax8WKBowrYnNi+6TaitUY3jmA/EJ9U8PfI4pk1t0PlFRF2shOP8WNcxLmrW0O4je2/BZt1cqxrabVCVrk8dL0iDQ== 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: List-Subscribe: List-Unsubscribe: cma_get_name() just returns cma->name without any additional transformation unlike other helpers such as cma_get_base() and cma_get_size(). This helper is not worth the additional indirection, and can be dropped after replacing directly with cma->name in the sole caller __add_cma_heap(). Cc: Sumit Semwal Cc: Andrew Morton Cc: dri-devel@lists.freedesktop.org Cc: linaro-mm-sig@lists.linaro.org Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- drivers/dma-buf/heaps/cma_heap.c | 2 +- include/linux/cma.h | 1 - mm/cma.c | 5 ----- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/dma-buf/heaps/cma_heap.c b/drivers/dma-buf/heaps/cma_heap.c index 4a63567e93ba..6ceb15060b02 100644 --- a/drivers/dma-buf/heaps/cma_heap.c +++ b/drivers/dma-buf/heaps/cma_heap.c @@ -376,7 +376,7 @@ static int __add_cma_heap(struct cma *cma, void *data) return -ENOMEM; cma_heap->cma = cma; - exp_info.name = cma_get_name(cma); + exp_info.name = cma->name; exp_info.ops = &cma_heap_ops; exp_info.priv = cma_heap; diff --git a/include/linux/cma.h b/include/linux/cma.h index 9db877506ea8..12ab7cd1d529 100644 --- a/include/linux/cma.h +++ b/include/linux/cma.h @@ -25,7 +25,6 @@ struct cma; extern unsigned long totalcma_pages; extern phys_addr_t cma_get_base(const struct cma *cma); extern unsigned long cma_get_size(const struct cma *cma); -extern const char *cma_get_name(const struct cma *cma); extern int __init cma_declare_contiguous_nid(phys_addr_t base, phys_addr_t size, phys_addr_t limit, diff --git a/mm/cma.c b/mm/cma.c index ed6581ef50c1..2627f4ba481f 100644 --- a/mm/cma.c +++ b/mm/cma.c @@ -45,11 +45,6 @@ unsigned long cma_get_size(const struct cma *cma) return cma->count << PAGE_SHIFT; } -const char *cma_get_name(const struct cma *cma) -{ - return cma->name; -} - static unsigned long cma_bitmap_aligned_mask(const struct cma *cma, unsigned int align_order) {