Received: by 2002:ac8:5349:0:b0:427:7d78:cd45 with SMTP id d9csp267397qto; Tue, 19 Dec 2023 07:43:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IGtN4wsD7oWL9zQ+fVebA8+k6PALsFw/A6kt2vibI2h9hO1rYJ897BLK1vxLBBzXmcv2sbP X-Received: by 2002:a05:620a:1268:b0:780:d918:93c2 with SMTP id b8-20020a05620a126800b00780d91893c2mr1694759qkl.15.1703000598788; Tue, 19 Dec 2023 07:43:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703000598; cv=none; d=google.com; s=arc-20160816; b=VeOuE95Pzncf4poud9JgdDzox4BRsIcL91jCWGkcC7Pp1qXF5wW34z9Ud189GOhm0/ UPZB2v4FE3aEKUnjqNjGG1Fj6462aOKyZTAp7zk4WIU21RD4jjckaoHL/Bc20YB08kKS HCkt4HDezROoRXMZkUmx4W+bmzEJ/AoyuQdniaekEwHi1d3RMFwf8cPb4HOCiB3paIvm 6IZhJ/O1+Yp5xWkemm19zjHQzTH3UkFtXqvRMtxEr6C2EEq3xeui3hrdcn8r0z8kVRQR 31NOnXCXeXlTV/vPyKP7YXj/vAas4RVuL+n5Hz7Azy0Hgg21kMR56aRYapeZhwud+Es2 8Xsw== 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=m7NCxZxfdIWbSOeJ5+vxWEkwjINwxH2Xsgk9Kkxd46Y=; fh=clCLtcTABqRvQ7dYdXRexdsvpI5j781VZj1OmkFsvR8=; b=sBFKxdVMnpZaXtrET3k5Uyy1heqhadG+OO0oAGYHq6918leFfW8S03ssJFopTTdU0H gVt+66gDiZivHYDFOW5HSxfRanwe6yp0Jcar/Ip9Wlwk0Pdcrqz5QfPba2jriIvzWpXX A1ObYfxkxtX3ArOhDBImdkiGzbFMBQVnthbjND+FMyxzPboiqeAbgcI1eAjRZwcSejHV KpjmnQp2O0UT5tckM3J/cPWefX/4iAHrx7NcCk8MgH2tSXDPqYMR9ITKDkzkZVhiCcwg nlW+zgpDQouzkrYouLH4jSC1oNzrdz7r1esPYAt3qZbZuW9XiikjbxgLheGbIBzKxykR c/Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Nut0wwAf; spf=pass (google.com: domain of linux-kernel+bounces-5505-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5505-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id z11-20020ac8454b000000b0042380a57121si24874709qtn.740.2023.12.19.07.43.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 07:43:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5505-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=@linuxfoundation.org header.s=korg header.b=Nut0wwAf; spf=pass (google.com: domain of linux-kernel+bounces-5505-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5505-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 57CA21C24754 for ; Tue, 19 Dec 2023 15:43:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DEABD1CABF; Tue, 19 Dec 2023 15:43:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Nut0wwAf" 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 1C77B1CF89; Tue, 19 Dec 2023 15:43:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3ED81C433C8; Tue, 19 Dec 2023 15:43:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1703000588; bh=Ql8eGZzccquuIXGz4rdOVYKLAU9LfVk8VwDxLu7AhDs=; h=From:To:Cc:Subject:Date:From; b=Nut0wwAfIZ/1YFZTjEZLhk060n1eGRbTdh0jfp0jBfrqJyBp0Ul7GG7UDU8A7UwA5 UjQ3Sygqcq6jtCxNzaoBC4mgY/hE1cB5f7ZgZqXyguIRnixvwGgGxLWyfW+CmM4QAa qEE4fnwYoj/tI62BWOwQGJo5BJ0sgV6RZcc/f0aE= From: Greg Kroah-Hartman To: mika.westerberg@linux.intel.com Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Andreas Noever , Michael Jamet , Yehezkel Bernat , linux-usb@vger.kernel.org Subject: [PATCH] thunderbolt: make tb_bus_type const Date: Tue, 19 Dec 2023 16:43:05 +0100 Message-ID: <2023121904-utopia-broadcast-06d1@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: 43 X-Developer-Signature: v=1; a=openpgp-sha256; l=1520; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Ql8eGZzccquuIXGz4rdOVYKLAU9LfVk8VwDxLu7AhDs=; b=owGbwMvMwCRo6H6F97bub03G02pJDKmNuzjz9PpUpdVOpS+WbT/w9uYV4/tNez6qsx5Q2sOrN 9n+39/CjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjIZlWG+eHZTZclt22M5haf PJUtQ9xaed2cfoYFm79r7dW6csLfQ/Js7Nf4jLxzwar6AA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Now that the driver core can properly handle constant struct bus_type, move the tb_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Cc: Andreas Noever Cc: Michael Jamet Cc: Mika Westerberg Cc: Yehezkel Bernat Cc: linux-usb@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/thunderbolt/domain.c | 2 +- include/linux/thunderbolt.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/thunderbolt/domain.c b/drivers/thunderbolt/domain.c index ec7b5f65804e..9fb1a64f3300 100644 --- a/drivers/thunderbolt/domain.c +++ b/drivers/thunderbolt/domain.c @@ -307,7 +307,7 @@ static const struct attribute_group *domain_attr_groups[] = { NULL, }; -struct bus_type tb_bus_type = { +const struct bus_type tb_bus_type = { .name = "thunderbolt", .match = tb_service_match, .probe = tb_service_probe, diff --git a/include/linux/thunderbolt.h b/include/linux/thunderbolt.h index 6151c210d987..2c835e5c41f6 100644 --- a/include/linux/thunderbolt.h +++ b/include/linux/thunderbolt.h @@ -86,7 +86,7 @@ struct tb { unsigned long privdata[]; }; -extern struct bus_type tb_bus_type; +extern const struct bus_type tb_bus_type; extern struct device_type tb_service_type; extern struct device_type tb_xdomain_type; -- 2.43.0