From patchwork Tue Feb 13 14:43:15 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: 200457 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp582578dyb; Tue, 13 Feb 2024 06:43:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IHvebA+q4O+aaO1IW9rbJMUZwOqnmncVZ63/fkuoB4FwlB5GUeIR5q25hGWSwFUJnBOjy/R X-Received: by 2002:a17:902:e9cd:b0:1d9:626b:ae3d with SMTP id 13-20020a170902e9cd00b001d9626bae3dmr8362248plk.18.1707835391261; Tue, 13 Feb 2024 06:43:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707835391; cv=pass; d=google.com; s=arc-20160816; b=u8aZvkQjNYTuwIszi9MMQAnJSrqJhBvW6sPnGIoStCRRqHNSmEEW5Yh+sYTDCvO1eu 5jlLTSR+dqDaGEaTVTjMc8eyPInfaekHZMIHOiNip4bRxA2QkWty7ZsNJQUsPR7fX73w pR1g4nkyN6Lf/EuaDbWUIdq7O3Z1Nm0k2XmvccEslmCkl2TXpntKHSgYjRgc3H9SR97m 5vWPrxIbtPRnrAkc+rmAQznl/FDpQVUYfY0BKw8zGsCD2npv696f9E01mtfr9KxgCKsV 05fki6+PBp1o+RIPZeLk7yNrehieK7QUoiybqbAlPfshEDljzBbcSDX2iPHl99Zrtd7W pO2g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:message-id:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:date :dkim-signature:from; bh=QxuGEKv2vwSIUHy4n7Mz5CLswGcccldauEpdNmNdUUM=; fh=8LdmKBXMMPnsGYtEhBSAwbYxDWNDTN8XuCakxq3yZp0=; b=fqswKPyjRmWrPhrAZ/Tm9uEJg+8yjm0IMqVUtts9rGIS34Lj47w1In1d8vmYEqEP4k jNZwvY6WOUYh3PTsNAih5XBaSfYVtoB8dSV8GO5duVAwB9Pfc4wRjn21Zbe7FO5URhki 62v7pjsisTsUdCiEtrlSjJ5++ZLPbE54IuSUKifA4REgygk4FDvkLMO0waWXol8OW2zb lha5dgPCY84v03gv/sYGmbwFjzNCaNraRcyK+5aSdDvBVbFdG3Gim2fKI4zqhWX2ymnm rqfV0rUFNfBd43am5GQ5KW3YW0Yy0ta6OT6NJHXxAhctdnSvQJMd2p4oKdLS6L/fPi4P 2+Uw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marliere.net header.s=2024 header.b=bGiYtAd4; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=marliere.net dmarc=pass fromdomain=marliere.net); spf=pass (google.com: domain of linux-kernel+bounces-63697-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63697-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=marliere.net X-Forwarded-Encrypted: i=2; AJvYcCWXY5tw4d0wYeboNnCRStaK5ltAXpxwsZbysodqjHLRYNDs3KhEAMO67IY6SGKXTtLuP0hDQ7UDV2vdqWWlPSJpA811/g== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id mc14-20020a1709032b0e00b001d9480d9091si2050514plb.484.2024.02.13.06.43.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 06:43:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63697-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=@marliere.net header.s=2024 header.b=bGiYtAd4; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=marliere.net dmarc=pass fromdomain=marliere.net); spf=pass (google.com: domain of linux-kernel+bounces-63697-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63697-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=marliere.net 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 14B2A287123 for ; Tue, 13 Feb 2024 14:43:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A2B795DF02; Tue, 13 Feb 2024 14:42:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marliere.net header.i=@marliere.net header.b="bGiYtAd4" Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (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 E5DD157899; Tue, 13 Feb 2024 14:42:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707835361; cv=none; b=SwUmPLUz3omkb4z69qnEVCgJUtH4E+aMR2hUOVU3AFnu2bW+kSuvI+MIX03IrVyPPI3oBjBGunfH0DQ0Q8cjTrJEY/UMhKMymKeDbgLO/WzAgcWl6fqv7E5txFNmU9kn+E4E/Z6znu2h0Et/k2cX4LYEBliPXsrHoUm93Zre/pE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707835361; c=relaxed/simple; bh=qx1rU47qp5SxtB5/of0+ajlZlnqS9KlZ7Xr19U+lVpU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=OOE+RS/ghZ/jUQcbp6ZYc4sV2W/7QtA0qimyxEAASEfd0jmsxC/uOFRl+06S+ekZenRRhdMTBvRkON7jI5Qd0DH3q0XPriEnanKwPdk3XiuqF3QBbonTDiPlFaygHJKOVV2MMnqtDfmwSJPEJoTxWO1tQQTLHGWDUApTNTKJWUY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=marliere.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=marliere.net header.i=@marliere.net header.b=bGiYtAd4; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=marliere.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1d8da50bffaso18515855ad.2; Tue, 13 Feb 2024 06:42:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707835359; x=1708440159; h=cc:to: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=QxuGEKv2vwSIUHy4n7Mz5CLswGcccldauEpdNmNdUUM=; b=Ez+6t1FsSpZPW22LviNQTfgvzxuNDQl2qW8Zx3lSKqQv+sUJ6uAYgBQHJPMmD4XaE3 W78gqTDSsmCo/1g4pkrnqu7pHxbjCEAntE0/GRJGUk0ecsv+qTwbJ62rp30UP3DBQHjZ VBfR5OwVTdTN1IRHyrFH/QLpNfLbqA0SqtU2pWOsqw2szDx3r170c30z2JShyB867oll jS56YnOIFdlhF2IRRxAOHv0mZMSGJY4hNvdnRYlpkbNGV9misvCeN/506+kczqvSO1O6 9THgu3h+IxksID1yEMu0xnQbBEOqtkyyvi/WO01tsWE6tQ1KR0v0Z9k2AOCVK8SO5E59 7l9A== X-Gm-Message-State: AOJu0YxhE/SoCH1+eFdLZCGRaXIF3wc5buOI0rbJ/r6RqONd7Fn2Z6bK P4WEVWPyad+luKstZK+2H+m11LEfIFJCP0Js+DVyY2BmijKNJ8vD X-Received: by 2002:a17:903:1ce:b0:1db:4b42:ce7f with SMTP id e14-20020a17090301ce00b001db4b42ce7fmr729213plh.8.1707835359251; Tue, 13 Feb 2024 06:42:39 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVZVMIdUeSJ81vLJoYvAoVbenJwn0AjPQgwaGjaqYVnfrSUug6IVOTaF5+DYc74P6OL6K5LsZda1EVP7A3c0J6dWVz8n/nA4ZHzlRa50ZkmcNf5JPpPoBvdKku26pcq90MPuyPgNQI1LY73hkGjl+KKquGj4L2MhaYb6E9EM0zUh55Hij2ZGIM33FiUYsU3zI0= Received: from mail.marliere.net ([24.199.118.162]) by smtp.gmail.com with ESMTPSA id kj12-20020a17090306cc00b001d9773a197esm2155334plb.209.2024.02.13.06.42.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 06:42:38 -0800 (PST) From: "Ricardo B. Marliere" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marliere.net; s=2024; t=1707835355; 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; bh=QxuGEKv2vwSIUHy4n7Mz5CLswGcccldauEpdNmNdUUM=; b=bGiYtAd4le2yypgeqY4HcQa5cf+bUV5RX0nLBtwWAPVfQp640jI4835vi7GbeuxJb0ji6J cm5U5m8LG3TLW30czXlAPcJVCfIQ6CvdGYrfQXXYWm9qZIVB98qc9ez9qwk1tmniDFu1Ag vvkyuLeT6TLMzMwgY7eq2fxfda9h4y74FR7CYR9+FU4xd4k9W1JP4/QqTgLjhSDBPw9EqO 4yHReqKb3z7LiDsDI6Wd2xOq7ag3Nq44/ktlGFvLkki0QXOMq3LSBwCbyPzqt6S8mbO9uo E4aD/eB2TmM0aKlqQrd9+9zAO1nkrPnD+1cjgg0Vj6ZXWoaDTFwslGyfMvWVJA== Authentication-Results: ORIGINATING; auth=pass smtp.auth=ricardo@marliere.net smtp.mailfrom=ricardo@marliere.net Date: Tue, 13 Feb 2024 11:43:15 -0300 Subject: [PATCH] dmaengine: idxd: make dsa_bus_type const Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240213-bus_cleanup-idxd-v1-1-c3e703675387@marliere.net> X-B4-Tracking: v=1; b=H4sIAAKAy2UC/x2MWwqAIBAAryL7naD2ILpKRJiutRAmiiFEd0/6H IaZBxJGwgQTeyDiTYkuX0E2DMyh/Y6cbGVQQnVCyZZvOa3mRO1zqKpYPjrUTmnXd4OEmoWIjsq /nJf3/QDBE4A3YgAAAA== To: Fenghua Yu , Dave Jiang , Vinod Koul Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "Ricardo B. Marliere" X-Developer-Signature: v=1; a=openpgp-sha256; l=1757; i=ricardo@marliere.net; h=from:subject:message-id; bh=qx1rU47qp5SxtB5/of0+ajlZlnqS9KlZ7Xr19U+lVpU=; b=owEBbQKS/ZANAwAKAckLinxjhlimAcsmYgBly4ADS36vQF93+0pXIsVYMlI7hG/r7uf9ssBSw QiwAJrTz8uJAjMEAAEKAB0WIQQDCo6eQk7jwGVXh+HJC4p8Y4ZYpgUCZcuAAwAKCRDJC4p8Y4ZY ptHdD/4n4SVsd1trzl4F4F2fAQKO4DWSVPw9jvc2Fc/CsncmwoT2vteYoMQGIT5T5rnZ0n4QO09 hWoRXSBExqYpNshXECiUFSKWzc++9Dmkkv90mNqe7DCw1ozuazzvvHZaViTivA3wKG/dLAV7Eo0 Om5SpAm6v2C3gUGspaiws/tfy+eZNXc6sg9E+fu7osyvXmJKU2NyEaEpy8vL9KyydTyx6qw/jPv 5d1EUVd6slGHWD6AVmHc9+4zKqRVsHvfoUg88kEn+3S0jDhu/WNu9r0VGTAY58AJj3UOBoz4nJ2 6m5y7QhZotnkKp+4vtjieAEb7BmEsBBgS/1ddfXVr6v1atXJOv/zkeeNWw63OAxCXzxAZgxvqaU XtgLstYwnybarNFxzqWzuTGpdLH/leonMc9c5cSrkcMmWkzlXXP5OO1jZfUpnomadjnrzelPwJC kMKELYHMtUhHRtaMX9sUXAWxdcmrElIHTEexzAGs2lnMd8fPxb21tHXQfaFrIPDMJbQXp5n5vj/ kPi+JVP/pRaAXOg/wAQ9uOt8IGBWjaajUTQIbjBRbeBPpLS3Fzvap2Y9NV5OTi26M8XdDQfyveX no2UhrhJBRxnSdqTw+oTn4vUVZlogDqPXaxpy5wp1YsItP9kOrRI6eauFDfzcFon78Ht/74eto/ 6mJgZXjcbkHqPtw== X-Developer-Key: i=ricardo@marliere.net; a=openpgp; fpr=030A8E9E424EE3C0655787E1C90B8A7C638658A6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790795203374694689 X-GMAIL-MSGID: 1790795203374694689 Since commit d492cc2573a0 ("driver core: device.h: make struct bus_type a const *"), the driver core can properly handle constant struct bus_type, move the dsa_bus_type 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 Reviewed-by: Fenghua Yu Reviewed-by: Greg Kroah-Hartman --- drivers/dma/idxd/bus.c | 2 +- drivers/dma/idxd/idxd.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) --- base-commit: de7d9cb3b064fdfb2e0e7706d14ffee20b762ad2 change-id: 20240213-bus_cleanup-idxd-8feaf2af5461 Best regards, diff --git a/drivers/dma/idxd/bus.c b/drivers/dma/idxd/bus.c index 0c9e689a2e77..b83b27e04f2a 100644 --- a/drivers/dma/idxd/bus.c +++ b/drivers/dma/idxd/bus.c @@ -72,7 +72,7 @@ static int idxd_bus_uevent(const struct device *dev, struct kobj_uevent_env *env return add_uevent_var(env, "MODALIAS=" IDXD_DEVICES_MODALIAS_FMT, 0); } -struct bus_type dsa_bus_type = { +const struct bus_type dsa_bus_type = { .name = "dsa", .match = idxd_config_bus_match, .probe = idxd_config_bus_probe, diff --git a/drivers/dma/idxd/idxd.h b/drivers/dma/idxd/idxd.h index 47de3f93ff1e..f14a660a2a34 100644 --- a/drivers/dma/idxd/idxd.h +++ b/drivers/dma/idxd/idxd.h @@ -516,7 +516,7 @@ static inline void idxd_set_user_intr(struct idxd_device *idxd, bool enable) iowrite32(reg.bits, idxd->reg_base + IDXD_GENCFG_OFFSET); } -extern struct bus_type dsa_bus_type; +extern const struct bus_type dsa_bus_type; extern bool support_enqcmd; extern struct ida idxd_ida;