From patchwork Sun Feb 4 16:22:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ricardo B. Marliere" X-Patchwork-Id: 196534 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp427706dyb; Sun, 4 Feb 2024 08:22:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IFRSkvn86rcpdoJba3TryWXXTLoA9fkBQW5E/EDczFQi7VQ04ak8a8+vyT3I4mViHKZBulI X-Received: by 2002:a05:6870:b50c:b0:219:a4e:e6b0 with SMTP id v12-20020a056870b50c00b002190a4ee6b0mr7094198oap.29.1707063737540; Sun, 04 Feb 2024 08:22:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707063737; cv=pass; d=google.com; s=arc-20160816; b=XOVN5tA29CsgVuYAvCY3F9KYm7BMGcmpNgicSzm6IbD/mHtbxv0eBo/cLlFGZ4MmEF PC81Llk0gd4XnY53MvvFlYclpv4R8Xz8SB1h+mXtASqTlrv8p0tHXNCtjC0ewoV6uhZa IYbp8MqBdYLTwqw72VQ1Wf4/0ADCIK297ErhkjeHYqueXR+fB2buhaWDpL3lSEwi+jsP zaP+lF7FJyGDCFfAm8VCGzUUJ5M1UJT4CQmRFmDoiLpMEWD4kqNiu7kx9gryUHqGzOK8 gC3F5CnFuyZ8kJionImBCLL0yP4T86HIzVKIONPk1mXPn0kKhEOAzkSowStvV6gYLin9 sclg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:dkim-signature:from; bh=QjiJPQVvtwUyBqU7KJO38zWmQJXbmgfQDFzxeewrpks=; fh=bGrMZQ8ULgw3CsNT3aMStAq36OzigxTvAeC73CECTIc=; b=HFQb92fT8/jQXDj5k8gBYi55/POZFl5VYlEQPdKSmCbPTQbVCFoBYurPYrhqh628XO tWcR15hSxEUdMDoXA+s1NKGXL2J17QapyP5x6/1ti7j3Qe6uMwhkddYKBVbEw1+qYPyG NFDlWO0KXnh06gf0t2OjRtQBKbjDOvIgdJZxL8rxrUBeB7yfnuleCda4HJ4KFMs3/Jdm 9ZYTpp4Z6raILdpXeL0W+TOYxHLjt9+P0gpaPAsHFcmLByQbQ9kGQgPFsUQuXMcu5gNV GDQAOGNFnUD1eFmRPRlU1sQqSHp7lpz0GQCWEn8a1pLHU+IVtTEEvK4MBse8SJoVYjWX PV4A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=temperror (no key for signature) header.i=@marliere.net header.s=2023 header.b=O+Z2XWVv; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-51779-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51779-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCUpz0dwH/7W9BDdl0UVjxIKUu9ylmh1p5W5mI2/bIdlavsW3TqOOrGOOJ1LW6hg7glgj7SrcxNwCWShtq713dVIObu1jQ== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id i9-20020a63e449000000b005d4c19b09c8si4494068pgk.432.2024.02.04.08.22.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 08:22:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51779-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=temperror (no key for signature) header.i=@marliere.net header.s=2023 header.b=O+Z2XWVv; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-51779-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51779-ouuuleilei=gmail.com@vger.kernel.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 22A94B22232 for ; Sun, 4 Feb 2024 16:22:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 94D69249F4; Sun, 4 Feb 2024 16:21:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=marliere.net header.i=@marliere.net header.b="O+Z2XWVv" Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C2BE22F14 for ; Sun, 4 Feb 2024 16:21:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707063701; cv=none; b=SqJjzckSdMWx5FHmCfq+G5GSX906eF/47an5MLVAfOi2cwTZJ7W5oOjUYnlnYV5yjdjnNmw37MJR6GEw0PKZKRF7Aypp6f0bmZAxug8BNEU9B2+4J+Q9IH2fIO4fmfnkdOZh/GNf4KVl5da7AIQ4IZZXs3Au6O2Nta1xrfn5PxQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707063701; c=relaxed/simple; bh=o2JftdH1Lhh0GDvslzWGXgMsYHPICO40Ht1z1kVrKj0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Spbq3NbdRz8NBlpLqUL67GZKeL7XDiO2Fe9aCkz5EurSpewivzkymxkTqPAuQCuWEsnL3Lrm/bjP3mxEUuE4PVSvm4WD5jiXbqiw1ch19FZ4YjmnurgLvz6sOCV4WMXetjluRPu1RUD61c/B7T+y7RxLIZrRR4nR8pseWy/q+7E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=marliere.net; spf=pass smtp.mailfrom=gmail.com; dkim=fail (0-bit key) header.d=marliere.net header.i=@marliere.net header.b=O+Z2XWVv reason="key not found in DNS"; arc=none smtp.client-ip=209.85.215.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=marliere.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-5c229dabbb6so2330021a12.0 for ; Sun, 04 Feb 2024 08:21:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707063699; x=1707668499; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:dkim-signature:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=QjiJPQVvtwUyBqU7KJO38zWmQJXbmgfQDFzxeewrpks=; b=Q4J8Z4COKOix1vleKs8DR6BWdX65PV80O+rVKhzMuRay2kyFzrZ2WxpimUKDt3c8sB DjM+AiaVOofgerXH2z7lUD/CYbr+F2u1h91C+7sGJxzAi1SmjQVNLdPonhBhpzC3NQJ1 IFMR2xeJn4LVzKlRc6LZCmxzVtxuaNM32ZHwCCHpW/v4mp/JxuYu7qB623Bi7UzCmk+c RiqU6I1hG4U4aHTLPR86UWN6db26qny2YiuZ16dJcFnh/vSEOboJPrBZqJwFXBY1k3ME 4YAgTS9xUGT8P8maJ99Ok4MaZJCRcVFMxt7eTxFYGKmNgKSp72sN3Wcldz0umimCXTah 6mSg== X-Gm-Message-State: AOJu0Yx5C2CECRYhEqUEfU9f17/V/QyveWvNveg2WU0X/vz42UZmJvMh e7BoWl83kdbX9dGq87QzA0/hswy9hbFuU8xF4QIWCUy0JZyjnsCt X-Received: by 2002:a05:6a00:2b58:b0:6e0:3329:1044 with SMTP id du24-20020a056a002b5800b006e033291044mr1675780pfb.29.1707063699536; Sun, 04 Feb 2024 08:21:39 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCUrR1KL5euiahwckJ9aaO9NAK2Z6RDRB7p1VBjX73QYAQuzLb4OEoHaNudmXQ7qO8bV2/O16epE6JYi0bSUCd+hMUAyZ5+pROfdp1p+Qmu4vwfocCgVpQJApXbIQ3n6jjpHR4JWnFxWnf+0QHBxB5H6vbg27cFsay39S3ZX0VnoedM7B6rJXkGFxmdVQwXOYc5e Received: from mail.marliere.net ([24.199.118.162]) by smtp.gmail.com with ESMTPSA id h3-20020aa786c3000000b006ddd112c7c9sm5140654pfo.145.2024.02.04.08.21.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 08:21:38 -0800 (PST) From: "Ricardo B. Marliere" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marliere.net; s=2023; t=1707063697; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QjiJPQVvtwUyBqU7KJO38zWmQJXbmgfQDFzxeewrpks=; b=O+Z2XWVvP0UMKrW1QPxP07yofSO2OaCGbAltbXl9QrHxKQiTW4R3a46MLao8mVppQFSQlY SoSOPJsMX/Nj7FTZcq9pdZ/VIvZvEVVS+PzwL6W+Iw4bf0BNlXNic4FQN1V7MbbgRnocp8 M8pdz0FeK1xgwxVSLwa1ek7QZXA0PY4DFP3It8xi5i8VgXJprQz+TwT2dak8WexMN005lC r07kNwpgzWxY7q44Bgw+quTsxTdflVyuiJwnFtJmrGbonZwpPEQ6Xs/NWBs6iwSCco5H4o qHGQE+QlUnxX89+pqiXVd5klgqTHNbHzpuqfcR6u8d7eFVq2Yq5WhzLmKPSMmw== Authentication-Results: ORIGINATING; auth=pass smtp.auth=ricardo@marliere.net smtp.mailfrom=ricardo@marliere.net Date: Sun, 04 Feb 2024 13:22:00 -0300 Subject: [PATCH 1/2] ntb: ntb_transport: make ntb_transport_bus const Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240204-bus_cleanup-ntb-v1-1-155184f60d5f@marliere.net> References: <20240204-bus_cleanup-ntb-v1-0-155184f60d5f@marliere.net> In-Reply-To: <20240204-bus_cleanup-ntb-v1-0-155184f60d5f@marliere.net> To: Jon Mason , Dave Jiang , Allen Hubbe Cc: ntb@lists.linux.dev, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "Ricardo B. Marliere" X-Developer-Signature: v=1; a=openpgp-sha256; l=991; i=ricardo@marliere.net; h=from:subject:message-id; bh=o2JftdH1Lhh0GDvslzWGXgMsYHPICO40Ht1z1kVrKj0=; b=owEBbQKS/ZANAwAKAckLinxjhlimAcsmYgBlv7mrsYfIx/tjByMzOoLAMVwhjhFxyD3oTBQsx 9ozryIlcb+JAjMEAAEKAB0WIQQDCo6eQk7jwGVXh+HJC4p8Y4ZYpgUCZb+5qwAKCRDJC4p8Y4ZY ptUUD/41Qi5N2w1Zlibh7z3PcppcnEYkxeEtme7bJ6LuGKcenNm3iPaZSn6RTbHLtiOa+L0PZEw 0XIQERCz0BHrUUi4Uk8D1ZN/Zxp571wZVKxO+ecTvI2VEN6fQF8+IavxwfQ0DVu2oSKnR21amY1 jk1KhtopQFV7+uGEpTZMqSP97drkrRt7niDw+Djt4ub87qA3tn6/0pomPqO9SD3+Q0T2L1Jbqma C+VikRZwu2QDV//aOC9eDryjNPVtohb+jdw9Tp6SMiukWF+ZxfYjgTxhv1e23XaUBGe87qaFH9i bDZ31lB82p/52hBPyN3UPAMhjufcX86xY+9UriEIt4YoMcuK1yyjsTSYAgCmM/yJ79ZXZYm5ybl LsGvERxf7mjEaO/UgfhDh5qIzsrzbQT+Q60zD/KkoPgG2b16ZsaDrY0SjZaKtkK+tI/zomZxo4U m0yDhgPpf7OZQSkMQJ2Kb2BL2t9ujImoIHr5S4nEmj8l35Wp2r4J3qU6bQ6pW67ROPhglAiMdgN WV7rjiy9ciTHIb6MHeh4NqJ3eUJGrcL80gi6YN8qpkAYmx4bE1j4StlapxxwsSUzgLCS4fRwSrm QdNzwp0I+dwmpgPGMt7L7ZHTsIxR7IzRDvP08ljLE4w6Ykvl8j9BGGZVJbJZwuq+qI77UKbjUTK 1Nh9ackxPgNawgw== X-Developer-Key: i=ricardo@marliere.net; a=openpgp; fpr=030A8E9E424EE3C0655787E1C90B8A7C638658A6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789986065909513889 X-GMAIL-MSGID: 1789986065909513889 Now that the driver core can properly handle constant struct bus_type, move the ntb_transport_bus variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Cc: Greg Kroah-Hartman Suggested-by: Greg Kroah-Hartman Signed-off-by: Ricardo B. Marliere Reviewed-by: Dave Jiang --- drivers/ntb/ntb_transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c index f9e7847a378e..0291d80611dc 100644 --- a/drivers/ntb/ntb_transport.c +++ b/drivers/ntb/ntb_transport.c @@ -314,7 +314,7 @@ static void ntb_transport_bus_remove(struct device *dev) put_device(dev); } -static struct bus_type ntb_transport_bus = { +static const struct bus_type ntb_transport_bus = { .name = "ntb_transport", .match = ntb_transport_bus_match, .probe = ntb_transport_bus_probe, From patchwork Sun Feb 4 16:22:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ricardo B. Marliere" X-Patchwork-Id: 196535 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp427778dyb; Sun, 4 Feb 2024 08:22:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IHkDE6yx1yx20Kjg4hcF9DaVO2Z0MDM1hLFGxWOM3Mqm1kP7J/jwj5J0/K8M4DWol9taMQW X-Received: by 2002:a05:620a:1104:b0:783:bd85:25f5 with SMTP id o4-20020a05620a110400b00783bd8525f5mr7194971qkk.29.1707063749432; Sun, 04 Feb 2024 08:22:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707063749; cv=pass; d=google.com; s=arc-20160816; b=C6h2hhNi9NsuoqjSky6+VjBsTUbnkDV6Lh5WxNFKQ0ETzJqrs+gceYfC4kDL9IonpT B7MnAR0+ID3+nF1f1GTX704+CIMc7ZXlkjV4bs5181qLNzesQ+19KSCZS6VJvQ+xPfa6 mu6+9c2oMzf5zJXYkPwaFkGiybymF9HJ7rCU9t9NPYSaNPODPMAAz6rincyvr7losNSA Uz7tkpcNAbmlINGL0VIQbKyYzGWi0ZPo8B8heP3d3Ra9dlZpFf1fButcERKUjt83BBmc lJ39DjI+hBeDClDIxcYlR0mHt94kJx36icafSP/LQPWyuU88qkLi1jXswiMj0qj4gZ8N h15A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:dkim-signature:from; bh=K1azqWxlvOqGmzrUiDwgL9sXxCK8hJ79amUwNn8f5PI=; fh=b8uUqA72JBIVrOmEx7XxFtqzDfl4hZ+iWiMSqapCZDY=; b=0/Pd5ZmaamtVLiklfs4TIJgMGWujnOORZ587JEjsIALXFQksAmfOcBZnRItHV1z02H UDENNVuaxoqmPqVBZnwJaagmvagct0d7g5+t8y/E33+VR1pNiMC2EdQGMlyJO8Ap9gwA 68wZvWW6iBCtHQ8B5+tA+0D2IobWtTgNZQJoXrOW4PQ8WubZjAZ2tx9CeWBLSy3hJScC E6vuh1BjDRcrJohD4CXlQFm1n4/p2+JA2EuaCyUmV4sUt966EPyJaHPWVluWN+kvuqkP oz/EdzOlpoFXAZYwNIzPRfjc6F36AoVaamVEWnr7twzo+dO/Wox57fDks+pLQERt4yti ogrg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=temperror (no key for signature) header.i=@marliere.net header.s=2023 header.b=CxdMg+vk; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-51780-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51780-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCUSRSAUZlcY5v0dUSCanIUOdtqCLgRo/k1otWPFkq0tuxhFf2n+jOSUoijP72uY7YjpqkGsJdJ9Fb0XSXtdlRa8G9Eg6g== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f9-20020a05620a20c900b00783fb5cf4d6si6446498qka.614.2024.02.04.08.22.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 08:22:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51780-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=temperror (no key for signature) header.i=@marliere.net header.s=2023 header.b=CxdMg+vk; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-51780-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51780-ouuuleilei=gmail.com@vger.kernel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3B42F1C2138A for ; Sun, 4 Feb 2024 16:22:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3667A24B23; Sun, 4 Feb 2024 16:21:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=marliere.net header.i=@marliere.net header.b="CxdMg+vk" Received: from mail-oo1-f42.google.com (mail-oo1-f42.google.com [209.85.161.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F086F249EA for ; Sun, 4 Feb 2024 16:21:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707063705; cv=none; b=C+8p7GEVj8rEK01rUKBjj15E8Ho9OCor+t5ORzKJva29dynTszXrVkEBqQEVeyodqLQyfaZmS4c1cqB2vNq7MgJpB4EmThNSfwnTxAnIVjGegeiU+HPw9mgYARfgm8oDCGViadaO5ROfhSolG/d3erB0oMSpLvclI+uI7WGr/jY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707063705; c=relaxed/simple; bh=whCsz08h0i58RqyKp8ULdq/KffGrpkytr5XrDDac73A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TQJw7LdBBfGvZ1uN0adOofM1YlYRLxhnnHasD9JCDOLoezz9ihlzc6BKXJZY9PGCVmPPu4cyO5SnddzErEcAHdOzX/AMRLU8BEiCvLyha+G6PlbUz/yIpQTuLV8ikiSVqSYLmrhZi9zGCWDdm36qG1V6FwzT2McuQCe8va29Qws= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=marliere.net; spf=pass smtp.mailfrom=gmail.com; dkim=fail (0-bit key) header.d=marliere.net header.i=@marliere.net header.b=CxdMg+vk reason="key not found in DNS"; arc=none smtp.client-ip=209.85.161.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=marliere.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oo1-f42.google.com with SMTP id 006d021491bc7-59a8b9b327aso1564659eaf.2 for ; Sun, 04 Feb 2024 08:21:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707063703; x=1707668503; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:dkim-signature:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=K1azqWxlvOqGmzrUiDwgL9sXxCK8hJ79amUwNn8f5PI=; b=YfO5q2D3pj/iFKb65TeylW4gLS8qI1/oKEYF40cx0eM1R2D9oKyM09rgIcB6bZdpGX W19l0Ll13DFVs664jlxxDy3A3XXd4HREJnH9SINlVwuU0fRsBnVgWnXzEsBMAs3Z0lQo +WYPJ9pAQUhSnvNwy9JX/XrtLsQLxBie20EiGOJlLGh5pgUQ6NMAVVHAaxfBtWK9cwW6 l6iWynILsswxPmwqPj5krVkQoVY0da5JGyHDaqkA8Ad5Fd3j9pVzBGLTKHOUnoQY7on9 IZIu6z9Wf7tL9nPoIWG58laXpqkjdHVorlpgqcSJuufEp4/mjZiJh+ayl8p9Xjta/BVI G0+Q== X-Gm-Message-State: AOJu0YxXtV5nYLwHLMNTHKOHMbE9/AF3t4sVdLMictrmONL94/UrnjZ3 If+jAWKv6D/GxQMExyNiln3f/S7gxElgJvPUxU067E5K7iEZLyop X-Received: by 2002:a05:6359:1011:b0:176:6141:48e5 with SMTP id ib17-20020a056359101100b00176614148e5mr8432454rwb.10.1707063702762; Sun, 04 Feb 2024 08:21:42 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCVzNmELDhKDwAdF7fxU3VjkJGOMlEATJVhXSMYG8QGPVYN4cFTsVOanXxWm/h64jMko6taWjgDoFDEVdYmccwcmTWycUrSi0RzKcbi2mLsBaNIGjQhsseX4bGGFcptoXBrJ9ZudX++zzZdIStnJixk1yulb2H39xGEgX5/NcTSx7erXJneHW9HAcBMi+Sm/t85H Received: from mail.marliere.net ([24.199.118.162]) by smtp.gmail.com with ESMTPSA id d12-20020a634f0c000000b005d8b89bbf20sm5232335pgb.63.2024.02.04.08.21.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 08:21:41 -0800 (PST) From: "Ricardo B. Marliere" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marliere.net; s=2023; t=1707063701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K1azqWxlvOqGmzrUiDwgL9sXxCK8hJ79amUwNn8f5PI=; b=CxdMg+vkB4kY9oEf/zuX2BfMsjMCxy2adbhuqXrgoOCnlmtCsMnb9hIDND0f0moqG3nmko jydFr/JTUaZVENlTXTMKYAzABYY5W9O5qBgpyNbcQLhuamJsLmQqMm79qn4WoM62opjyv7 mSqu/q0bXZJ42Cv6tFjPpLR8MewRY4jy8q7Q0HhhZkMNs2C9M8XnKNPxXN8wWNa/b/HGrg MDz2pguascEUqGHJzIBHYl7Q5KbHMmZA0g2OB3ugSdTiO1wAU7eRIMtkcsGKEQpdeMyr21 /cNzrpl1tKCYhvCa0SLa9DSPJcHOwwCSa5f1Kl+bcn3hKjy8x7HDhJkyRTOA9Q== Authentication-Results: ORIGINATING; auth=pass smtp.auth=ricardo@marliere.net smtp.mailfrom=ricardo@marliere.net Date: Sun, 04 Feb 2024 13:22:01 -0300 Subject: [PATCH 2/2] ntb: core: make ntb_bus const Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240204-bus_cleanup-ntb-v1-2-155184f60d5f@marliere.net> References: <20240204-bus_cleanup-ntb-v1-0-155184f60d5f@marliere.net> In-Reply-To: <20240204-bus_cleanup-ntb-v1-0-155184f60d5f@marliere.net> To: Jon Mason , Dave Jiang , Allen Hubbe Cc: ntb@lists.linux.dev, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "Ricardo B. Marliere" X-Developer-Signature: v=1; a=openpgp-sha256; l=1215; i=ricardo@marliere.net; h=from:subject:message-id; bh=whCsz08h0i58RqyKp8ULdq/KffGrpkytr5XrDDac73A=; b=owEBbQKS/ZANAwAKAckLinxjhlimAcsmYgBlv7msZcSD4qoPu9zwiVBcachyuBTMd9GvMQabu JmJUIfJi0KJAjMEAAEKAB0WIQQDCo6eQk7jwGVXh+HJC4p8Y4ZYpgUCZb+5rAAKCRDJC4p8Y4ZY pkqLEACGTjC2kEyiouj+vFMWhl6ZY5OArxAOjO4RjgPcmnC4Qw/aR5riG36KNV/Q27Z1PBdiE8r cd2uelujSEOhlcEZBStiqoeQ6djMCvYfRS/+39SJT2dg9sp6ytRtABTQJ8eJbXqH1TXNNFayxAB Y3yrsuvXTgwnC3pH6DUDhrHsTqam9162EEfMefKcPb9d+aLLb55JHriIvW3xVPr/11NTLhpijUJ xjOAJGCu7IVzDH9hvkVxaigXbja1aSjKrLfsMNOdC+eN7g/FBSasyDsqylGskOx85xFYX9kEmk/ l3sE2zDg8Z+f7RVb4Itk23nYF6Q0AcAaDjCU//Bb+bXbLj74Qa5rmY7J6S5MvFgsg+BmEt5mj+H /RslGj+/G0gUaUozu4ZYyiLw+1Ir7pfP9xbDaWn26PliGmE5QDGu01S8kwCF1e7784cOfpCHEy6 vuRhPc76HnLS7hwAKbpS4J5IofFSwBiSHzRIVWkNT5Pe07uH1EBBdcVu40ZayrMEbTdD5wIJ8uX jWyCPvg15C4ZM/FHUEASsR3fKkW6Mw79CZZvpdMpWe9uBm9LNANAp/Iz898JrQYvzTVVx1/tFaA 256HZ0DWl0SMW+7eUAb+uVd2aONhFsU24WNl7gDSXshNnS8U80WDlm5SWZerQCqL/5kLVdlQ2sh xrf7mJYpUbWb/+g== X-Developer-Key: i=ricardo@marliere.net; a=openpgp; fpr=030A8E9E424EE3C0655787E1C90B8A7C638658A6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789986078058105798 X-GMAIL-MSGID: 1789986078058105798 Now that the driver core can properly handle constant struct bus_type, move the ntb_bus variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Cc: Greg Kroah-Hartman Suggested-by: Greg Kroah-Hartman Signed-off-by: Ricardo B. Marliere Reviewed-by: Dave Jiang --- drivers/ntb/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/ntb/core.c b/drivers/ntb/core.c index 27dd93deff6e..f32b77c7e00d 100644 --- a/drivers/ntb/core.c +++ b/drivers/ntb/core.c @@ -72,7 +72,7 @@ MODULE_VERSION(DRIVER_VERSION); MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_DESCRIPTION(DRIVER_DESCRIPTION); -static struct bus_type ntb_bus; +static const struct bus_type ntb_bus; static void ntb_dev_release(struct device *dev); int __ntb_register_client(struct ntb_client *client, struct module *mod, @@ -292,7 +292,7 @@ static void ntb_dev_release(struct device *dev) complete(&ntb->released); } -static struct bus_type ntb_bus = { +static const struct bus_type ntb_bus = { .name = "ntb", .probe = ntb_probe, .remove = ntb_remove,