From patchwork Tue Dec 19 13:41:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 180945 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1943463dyi; Tue, 19 Dec 2023 05:42:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IHVsJiqxc4m7L1kkCdRqGxIdPOsF4ZZHwtd6+WtCu3pvFWZAUA5bCdSgB1PUvuWX8nfHAst X-Received: by 2002:a05:6a20:d41f:b0:186:ff2d:f964 with SMTP id il31-20020a056a20d41f00b00186ff2df964mr16926904pzb.36.1702993327449; Tue, 19 Dec 2023 05:42:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702993327; cv=none; d=google.com; s=arc-20160816; b=cgvL1xbVYJZhZQX8OH7t6khZNwlDX6a1iCsz9vD4qCWJGahVUdq1JpQpQLys8hZNO9 /1yMw0HZklqlb+F1aSTFCgUZZmd74n4CjoKryITjFej3a2AYp7Kqh5y928nDVcJVxfMn xqTvrMdWKOU3agT85NWyRACOzqECliIFDocuNrv+UI7hNqLV/4u7jPigPQIayA73dkbn UzPRxX5GFxbNzDB0OeM3C6R9QqS0D66VWjVEX4Yd7/DPCG+Nh/+72sqfIRp/wVovgB// h9ZfFQgU9nCwznnMpk6RHx4gwW+Tr6vBzulFqBq0NwZKi960OzrpuoRs/bcN1fpe7QUl XtgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:lines:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=p1o2H0k2oZ3gWjZDqtqQWceq7APCK2Fk+2KJLihG9Dw=; fh=7Qpqgnsc+p8tKJkjH2MMSlVMvanizMduFu+8Ju7vvxw=; b=VEsUCHQgSrnMNc+6Na6Sf0u7qTAKoKCEW0Q0E4fNjrvqeXuQioeOmt9JFBd/SZzdnL xqyk2qtaHMemkhKuM1wtXwpAcMp4gq+KFrPy0J5NC8UXBuCbQl02GV0Xjh/AElxseJ94 UnnX3cH/GhiDM8aQF2sy1imuytx56zacdJPnEtjjq1ciUITQYgSZc9atVAVZyeL405n7 paekt3f1TRwmRje6t13Z/9e2kgpZtvYraWBU1qxmACUCmgmVyugCRJQrYs/C1Ky7Oul/ Y+1kzeIB2U7StvfH7sdtp3z0DpD+dOQQYOvg8GMVlaEmxxkzCKXJj9nN6Y2PazJ0R7T0 +Fsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ClGsWkTw; spf=pass (google.com: domain of linux-kernel+bounces-5270-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5270-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id p13-20020a635b0d000000b005c65defc400si3252628pgb.624.2023.12.19.05.42.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 05:42:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5270-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ClGsWkTw; spf=pass (google.com: domain of linux-kernel+bounces-5270-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5270-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 5628F285BB2 for ; Tue, 19 Dec 2023 13:42:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E739F1A27E; Tue, 19 Dec 2023 13:41:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ClGsWkTw" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22BF119471; Tue, 19 Dec 2023 13:41:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 508A6C433C7; Tue, 19 Dec 2023 13:41:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1702993310; bh=F6ar0VqlrkPhdaatE1FLgFCrEDi1gq3l55wVb/ojN9w=; h=From:To:Cc:Subject:Date:From; b=ClGsWkTw0Noy5KB0LJ5GhsqpJozgFV7MSyHlFPhrh96qDaajKX8+H2kqD9Svd3IxY CO+VR+Ca7wSECggtfKKf8o9u1tOErpLpw2qpgy/U7FSCVxKSseZVMhq+6dG0W6sej0 j0ih/zq0r/CTXT+WyY80ouDSt8T9Jak0Bz+ZTVck= From: Greg Kroah-Hartman To: hch@lst.de, m.szyprowski@samsung.com Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Robin Murphy , iommu@lists.linux.dev Subject: [PATCH] dma-debug: make dma_debug_add_bus take a const pointer Date: Tue, 19 Dec 2023 14:41:42 +0100 Message-ID: <2023121941-dejected-nugget-681e@gregkh> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Lines: 47 X-Developer-Signature: v=1; a=openpgp-sha256; l=1752; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=F6ar0VqlrkPhdaatE1FLgFCrEDi1gq3l55wVb/ojN9w=; b=owGbwMvMwCRo6H6F97bub03G02pJDKmNc6e2Hm2dtNjAb48Td1VWxdacZ2x//KI6RKMV169z+ xWxlC+hI5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACby1ZFhnpb8PKZVb6RfbLzR dbF5He8WzqOFVgwLlsfOYvq1+UZnech0Y/21E1a5iT9PBAA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785717931129395695 X-GMAIL-MSGID: 1785717931129395695 The driver core now can handle a const struct bus_type pointer, and the dma_debug_add_bus() call just passes on the pointer give to it to the driver core, so make this pointer const as well to allow everyone to use read-only struct bus_type pointers going forward. Cc: Christoph Hellwig Cc: Marek Szyprowski Cc: Robin Murphy Cc: iommu@lists.linux.dev Signed-off-by: Greg Kroah-Hartman Reviewed-by: Robin Murphy --- include/linux/dma-map-ops.h | 4 ++-- kernel/dma/debug.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/dma-map-ops.h b/include/linux/dma-map-ops.h index f2fc203fb8a1..e401f824a007 100644 --- a/include/linux/dma-map-ops.h +++ b/include/linux/dma-map-ops.h @@ -443,10 +443,10 @@ static inline void arch_teardown_dma_ops(struct device *dev) #endif /* CONFIG_ARCH_HAS_TEARDOWN_DMA_OPS */ #ifdef CONFIG_DMA_API_DEBUG -void dma_debug_add_bus(struct bus_type *bus); +void dma_debug_add_bus(const struct bus_type *bus); void debug_dma_dump_mappings(struct device *dev); #else -static inline void dma_debug_add_bus(struct bus_type *bus) +static inline void dma_debug_add_bus(const struct bus_type *bus) { } static inline void debug_dma_dump_mappings(struct device *dev) diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c index 3de494375b7b..1a5c86dd87d5 100644 --- a/kernel/dma/debug.c +++ b/kernel/dma/debug.c @@ -876,7 +876,7 @@ static int dma_debug_device_change(struct notifier_block *nb, unsigned long acti return 0; } -void dma_debug_add_bus(struct bus_type *bus) +void dma_debug_add_bus(const struct bus_type *bus) { struct notifier_block *nb;