Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp503109rdb; Thu, 8 Feb 2024 12:03:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IGqnLDeSxzznh7sytZmfgNyy15NPfVcbLArX1DskMoQCnlTZlPMrfYGN85tgvvEzNSUKNrG X-Received: by 2002:a81:9e04:0:b0:5f5:bdef:748b with SMTP id m4-20020a819e04000000b005f5bdef748bmr409244ywj.47.1707422579849; Thu, 08 Feb 2024 12:02:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707422579; cv=pass; d=google.com; s=arc-20160816; b=jIUvxd71phNIE+cO3EpIQheLruQmrwXeJigjcnV2f5y3AQ961xBy6ztWh3sWggJ0gA smZMnmkSiSAxPcMx8YbyfEkbANUOaEHhPtW6BxvFfIcLS/v8ynoAGFuoeYvFjGPlD+QU GvC3sWgKO84bgesC+lnZAYBBCl4pLGkO7XQsXtA7llEp9XBvDsvSeTtyFv7PIqU7EMb7 GlXyeieGQU6DqhCSi3UxRcwDg5V/TyCWV8/YYJDWreUv9aWksUJIvdSrcx2ukhOC+9zD q2YB3s0YVrkclnx/oOhklSAZ2npGRIfiacJtZpa/QIXWxTJKvDUYZ7fvr1xUbeuuPk95 wNZQ== 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=yEe9Wy1b0zH9GvqFkXuxdhjDPzE0yMoBbpTR7V7GZ+M=; fh=subpOjx1lfDVuwNTF8QaJB/PhrMVgMPtop7CUjFhNFo=; b=t09u7/ZOmMETXnUeotoopiGrX3gIj1gZ8ffFfpuW1mJ13teZKStLVbrnRGMfMtx9we uEJdE0iUR64zhAoT0sFd0rPcr4kDeqst/g5DUsHM5PydkU0Zr9TOeYJ0kyZxTrT8A/IZ SrIa+n0nbuAWTqQ55+fNIQtWR1QC5ILI42CT/C+sMa76OpIb8Ax/jSa16pNGbkujomso hBVHsYbvqpuWtQpKSZ+31lzNsgOf8pQ/dMNzEBzuo+xTen45ARJRmBXsFJZ5SAOA3Uwm FoWWwOCCD8+ELF6K2BPySQJ0B4eGpTXjQQBjfWDCJ16KaimzukXCxdqUQnUo3jVqXr9S if6g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marliere.net header.s=2024 header.b=Hkh51lOG; 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-58642-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58642-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=marliere.net X-Forwarded-Encrypted: i=2; AJvYcCXsxzJ2rpaiJ+2iS+c04ZxCgq5UfCmQxJ6Yfs/a79oghgiUdcFh+3TeuMU74Hu2rcR0rAjOW0HLik3g14OLt/xslv7yPT3URx2EG7MsrQ== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id jg11-20020a056102180b00b0046af251e1e3si15723vsb.213.2024.02.08.12.02.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 12:02:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58642-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@marliere.net header.s=2024 header.b=Hkh51lOG; 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-58642-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58642-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 1CE111C2449F for ; Thu, 8 Feb 2024 20:01:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C3194383B8; Thu, 8 Feb 2024 20:01:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marliere.net header.i=@marliere.net header.b="Hkh51lOG" Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (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 8F076381C5; Thu, 8 Feb 2024 20:01:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707422494; cv=none; b=oZjDvKp8FU7Z9iYJTxGeuiUzmNxsh3Y+hdkHfTG0oSluUULrp585sadl32xhNUkme5aV9KeMHwwgyU44g/3pA8jZhxLaIkTyfE7gpWj5WRXbtLPAKrpDIuDNtpvYtWRPlF+HnaYK3OknaJyT+29jIlxHNYe+qN0LYmAxJfj/o90= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707422494; c=relaxed/simple; bh=P0NUudkhr32cG7/aid0oQ2TiIP175J8zDSv6y5I26BM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=Ne03fWTQIoVz/152JQvhoGlwfUFDic+hdW/lG++cMYkrz7R3aMuaAb3HnOZRSllnPCAFb36OISNMJ5GOgs2bK1sjNb6KmiuznoHzgm25mEHRgTWyq36tB84vozoY4TGOJNwDLs3R7NoEUhzlWvJiB6nCV2FYLvCXMkTGy/qqt5c= 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=Hkh51lOG; arc=none smtp.client-ip=209.85.210.176 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-pf1-f176.google.com with SMTP id d2e1a72fcca58-6e065098635so167256b3a.3; Thu, 08 Feb 2024 12:01:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707422493; x=1708027293; 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=yEe9Wy1b0zH9GvqFkXuxdhjDPzE0yMoBbpTR7V7GZ+M=; b=kx6/QMVvTjLGOAMc1iHITR0snnHgjpbKmP5PB9JDkbfjyZPugecN546DX9Jdxsk2Jn pFJdSXKjL0P0YHDQLSQoy5RnUxlY+gG+jOY04zKbbTeoBp64bwgVF2cj2aCSgHOCWKt+ 1kESPQXX2GogEoEWcAz2wi7qInH5RH9zAFljDIidWfElv9lIaqmc/mbT7wWMyaUe3Rie RFwXG9w9pYFdWyx81SLJSUaELm0FZMZ5aeGlomLivcYgUdbtfF7lSz2GAeG2SSHBCr0s EMkR6YG4tHp+EVZPYNtcu5In3UuPZoFEgOfeJD86XxU1UyWOVoVrGhtwvNrLEZxpRwyq L5NQ== X-Gm-Message-State: AOJu0Yx87d8D+ZDnmcN6lP7+bZjNhZCkZVLKMY7l5G+4O7zt7m4vrHJ6 6YqjiHdZcfiY7lXgA6xgh/GbIYnPyEPAfleXJ0PpHuQyDSOSBNk1C4livddzCs/AXA== X-Received: by 2002:a62:d450:0:b0:6e0:527f:fe6e with SMTP id u16-20020a62d450000000b006e0527ffe6emr289512pfl.0.1707422492815; Thu, 08 Feb 2024 12:01:32 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXKpvKr+7nwxl7LHNfoIKyuuyHKjzm8XigDNZzmVwjCKI9BdAfGYdiKUnIl/2xW4GRU5LDbX8ysVf7O46knTYHIDAG7cDi6TyhTf2ra47C6dKkqVmaETuwdMcVWHWFkCtZTfg1ijRMDPH8yMSwNy9n8X2eqd1IQsHCEwBxIJyCqA7rF6ko= Received: from mail.marliere.net ([24.199.118.162]) by smtp.gmail.com with ESMTPSA id gx14-20020a056a001e0e00b006e03efbcb3esm137792pfb.73.2024.02.08.12.01.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 12:01:31 -0800 (PST) From: "Ricardo B. Marliere" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marliere.net; s=2024; t=1707422490; 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=yEe9Wy1b0zH9GvqFkXuxdhjDPzE0yMoBbpTR7V7GZ+M=; b=Hkh51lOG0vEMTR6k4TMpp5P4/a1/5aKcnp4xHR32wiRjP7yUIyTcCU95N1nHy8cnLzMaVH qKT2PmHYo6NjfQyFQM0/vrKa3bh0BVOS46oVciaoO91/u3w2RX18AbTigXjOFPx/e2/Qgy zW6kOXG9dL0cGSRZ4X19Y5EAd7GZV9+m8sUuYTmbUdn+qWhQCKPCj5JxqEipqv/kmvof/F PyfD/ECipdwYqv/xb0es+0KiL4fJjDXbmbgj7sX+2ZgD/XfxdAJNOsPx7YC0l2voHCfg4k vCygefUCA/xHs71Pa/ZNgamtiLeFSMpLUiTOltjtUapQ0wzB6wSQu/5UW4ffJg== Authentication-Results: ORIGINATING; auth=pass smtp.auth=ricardo@marliere.net smtp.mailfrom=ricardo@marliere.net Date: Thu, 08 Feb 2024 17:02:04 -0300 Subject: [PATCH] vfio: mdev: make mdev_bus_type const Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240208-bus_cleanup-vfio-v1-1-ed5da3019949@marliere.net> X-B4-Tracking: v=1; b=H4sIADszxWUC/x3MQQqAIBBA0avIrBNUsqKrRITVWAOhohiBdPek5 Vv8XyBhJEwwsgIRb0rkXYVsGGyncQdy2qtBCdUKJQa+5rRsFxqXA78ted5r08lBrBotQs1CREv Pv5zm9/0AgaM6qGIAAAA= To: Kirti Wankhede , Alex Williamson Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "Ricardo B. Marliere" X-Developer-Signature: v=1; a=openpgp-sha256; l=1646; i=ricardo@marliere.net; h=from:subject:message-id; bh=P0NUudkhr32cG7/aid0oQ2TiIP175J8zDSv6y5I26BM=; b=owEBbQKS/ZANAwAKAckLinxjhlimAcsmYgBlxTM8DUjxBAKGg8kKde2XCEznhpTh+wTFuCoZv fGzHUAgeTyJAjMEAAEKAB0WIQQDCo6eQk7jwGVXh+HJC4p8Y4ZYpgUCZcUzPAAKCRDJC4p8Y4ZY psZuD/9bh3JFq/UYSclCldBhiv4hq59N6gkvalm2HNd0afNc10oNRrki7h0OzJdX//D7TPGsrG4 z7nF60uFQ8r/DIVRw7FMf5tQKpw6gsla1MesFrZdc+FqWxZuElUSopV5TZeJ/2ahyoQy4XeQHgY ES9+xxeBGyYUjjD7Kpm2sCELN243O80leyhsqageCIwatWvimankkhI7FmkbyYNPTWriIQazq95 8eTmejxdHHUaK53QWVs5g8LaULizdwmPiemfGMgIGlcv20mZQ3EpHw6AoA4eGXuKO0/wynkZuMe sVISMN7FO2DHQj3Ri6jrnB5vyX7Shrk+ilVOKMvZf+vZ2C2VNCXRTjyNntoBShH0TOjsNRFF8ay VUa2Pd2uVLJTzhbNLGQ7xsL/Dr8wAq//kVg9cmI1YY7OKG0JTcfYQly1jZ+BqTRcklqfFd8F8DE BZ0e6iVYuJ1+i6iJkb0M/EsieME5jp2FZw1m/nnG8o67FlMvpYvzMvWJITTmYtI1O1Iq4sQUm6+ T50aa1PWCiSGYlzDBNY6AlN2pLZM6WSkRskBjrHYrTu7lwvJsCiuhA4HV/S0ahpoiOO7tSKMYIY dPDwchf6ZfJFX86FCb3pIzKYH2JQFRezp/LN6kS4j8x4hGAeUNTn39Z/fqv1ThrE8FQfwxMgxmL C2jUzInNsT2TXKw== X-Developer-Key: i=ricardo@marliere.net; a=openpgp; fpr=030A8E9E424EE3C0655787E1C90B8A7C638658A6 Now that the driver core can properly handle constant struct bus_type, move the mdev_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 --- drivers/vfio/mdev/mdev_driver.c | 2 +- drivers/vfio/mdev/mdev_private.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/vfio/mdev/mdev_driver.c b/drivers/vfio/mdev/mdev_driver.c index 7825d83a55f8..b98322966b3e 100644 --- a/drivers/vfio/mdev/mdev_driver.c +++ b/drivers/vfio/mdev/mdev_driver.c @@ -40,7 +40,7 @@ static int mdev_match(struct device *dev, struct device_driver *drv) return 0; } -struct bus_type mdev_bus_type = { +const struct bus_type mdev_bus_type = { .name = "mdev", .probe = mdev_probe, .remove = mdev_remove, diff --git a/drivers/vfio/mdev/mdev_private.h b/drivers/vfio/mdev/mdev_private.h index af457b27f607..63a1316b08b7 100644 --- a/drivers/vfio/mdev/mdev_private.h +++ b/drivers/vfio/mdev/mdev_private.h @@ -13,7 +13,7 @@ int mdev_bus_register(void); void mdev_bus_unregister(void); -extern struct bus_type mdev_bus_type; +extern const struct bus_type mdev_bus_type; extern const struct attribute_group *mdev_device_groups[]; #define to_mdev_type_attr(_attr) \ --- base-commit: 78f70c02bdbccb5e9b0b0c728185d4aeb7044ace change-id: 20240208-bus_cleanup-vfio-75a6180b5efe Best regards, -- Ricardo B. Marliere