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: 197167 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1311276dyb; Mon, 5 Feb 2024 20:15:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IGCHg3ILqnxh6I8CRvM8JZUc9yQGbys2pHVqcLt8f/MkNGt34lWoZzBBjOd/CDJs611sSd4 X-Received: by 2002:a17:906:a457:b0:a36:fe5f:12ea with SMTP id cb23-20020a170906a45700b00a36fe5f12eamr659463ejb.11.1707192946146; Mon, 05 Feb 2024 20:15:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707192946; cv=pass; d=google.com; s=arc-20160816; b=V/LKGAw/f1Ha7iWT72rSyaKjyH70wO3QNZoBYkf+++XSBboWXH+abagz0gdsAWMCoQ F6AvLmMFyhjdb/kpulpqMo2w47XR0WU5lc7tu2IkCN5j9OYRAQfu1g54DjnNGljm8RXE GfL96azijP6jOtlHJczReGg9GmDjyiaA+2VOiz7T+PqLqwlLkTnsqBYDFeZ8y+TEIHux /zg1hYe5pw2m9PYnPxYf4xmiqZulF4z5TMk9Hfeb4cTz6GinQHPM7GByru/saXz6NU3F ChyRkgFMt+67gSYbU6T6ksPXpch3JwPe9cixuayBvY1+ojqrt4uWK0wlSsSnzsh+JKJg Zs0A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=Qpg2M1ys7m9eyeO0UXQxStNIQZV72frkHH/ikrNRvJw=; fh=9oH/9i1evbeXpseHGn5TOuRHT6oJDjeOM9zLCA0E5zY=; b=Dqan5RLoPD4fVBnbaHG/InLzYna2nL6x7G7tgS4g6qTI2W3sxDbfncgI/vLC9N/hqP aBqG0o2Tcti3T0RrqifVScdHfVR8ZQ0FDaHWDTdNSk3HL54aSMtlh/fb4Gwza4YW7fFd tQy+uoEyVzU32jrIhWqUogF5L0LAG8WaZoJUvazPy+/odbGbHrYpJsNtMJitpM7zM7kq 9+fNo5Cu/K57LkRHAkJ997R5LVCtJtnpANeOwzShBU3dVIvpEiWrtLYw6zHjJNZG6nl1 b6Xe+wxEgCVBTNfarKjpZUfTBfXUxWON9aPcdpNndePq03oj80hExl+vUAv63HEmIHKh yETA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-54288-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54288-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com X-Forwarded-Encrypted: i=1; AJvYcCUVHXYgpx9teVqwhjUUNXkzqSiPnn69LvVmNgpOEgeMMUNI7t8Dn5rgJiBBRY/otv+PTAqJBTnpkMffsX98qbkDfaz8ig== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id s25-20020a170906bc5900b00a36ba4256e0si598308ejv.861.2024.02.05.20.15.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 20:15:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-54288-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-54288-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54288-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id BCA1D1F24984 for ; Tue, 6 Feb 2024 04:15:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C8FF74E27; Tue, 6 Feb 2024 04:15:32 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 781C26E2AD for ; Tue, 6 Feb 2024 04:15:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707192931; cv=none; b=JZGZ0kZFAr4j4bVPxJ49wW3jW4k0yoaEJZin1HZqQ7Nvj2CZUbUOxqtDWoZoWPtYy5dbYoRGn4ecCFVCGTuCJYfe7sdQuAhHlf6GB2cyuTKmQATcF1emC+jDEKzrip6pXdZMgcNmt8aZIbgygdbbCtvIzc4ylZbeekTCeFHu3+4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707192931; c=relaxed/simple; bh=kIavR/BFjazMLlOAuCnn8Q2ySkLNfpme59v/QVt+OMY=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=d5ZEgC8724ObmRcCEEdu73fCGkBA5s4ROCCsqYy6EzSNoGE2O+kBT82TnLhg5yCoBP8++wk9vUoqXLB0amihNvXDy5kDpgPng9Gm7eXP4uD3ChhuxHZcJvmE7HyrkfoOxaKUgplNRw0549DGZT4akubpJpf/m6Nm+TOIN6+CBVg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790121550500121750 X-GMAIL-MSGID: 1790121550500121750 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) {