Message ID | 2023121904-utopia-broadcast-06d1@gregkh |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-5505-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2027581dyi; Tue, 19 Dec 2023 07:43:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IFkWgsUX2qCLRz0HtO3S94mDtG1Ep1l1c4vZpibqZpwUFJBALkP/oqgDS6rm8k3qQPAyv8f X-Received: by 2002:a17:906:7248:b0:a1f:9842:5a4b with SMTP id n8-20020a170906724800b00a1f98425a4bmr1270414ejk.66.1703000607957; Tue, 19 Dec 2023 07:43:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703000607; cv=none; d=google.com; s=arc-20160816; b=qmd0RGNJEelxQDmG//AARE05U9byTRjpphnTJ+TYnNlEojpII4cztBJ5Tio008UUv5 +1sxtl1P7ejQn7vygdu4udcOSa24is/C0207WkKy2MxG2EcG4erMaVvHa0E7JuryPc9b 5CjcnQCZIX3F152s/vcwyfmCsEZBc+Rj7MqlCWA+yIKRbuIlt+OcUWP2sIEzhmzZh9BO dJYCaJEHWuVoJoAbeXVPQi54XA+Nncu+OjZA/sWKibhP/kXtU0b1NmFDKoD8fDScNuJg PrRpd1XyROGjdtxAr5HyNY1uYqwY/CuB4oCCDnu64+VPmF0mzxscIVA32bbLiYJwAFls cxvg== 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5505-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id z2-20020a1709063ac200b00a22fb471e43si5986461ejd.88.2023.12.19.07.43.27 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 07:43:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5505-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5505-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 8E0F31F218A8 for <ouuuleilei@gmail.com>; Tue, 19 Dec 2023 15:43:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C52431D120; Tue, 19 Dec 2023 15:43:11 +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 <gregkh@linuxfoundation.org> To: mika.westerberg@linux.intel.com Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Andreas Noever <andreas.noever@gmail.com>, Michael Jamet <michael.jamet@intel.com>, Yehezkel Bernat <YehezkelShB@gmail.com>, 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: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785725565443906679 X-GMAIL-MSGID: 1785725565443906679 |
Series |
thunderbolt: make tb_bus_type const
|
|
Commit Message
Greg KH
Dec. 19, 2023, 3:43 p.m. UTC
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 <andreas.noever@gmail.com>
Cc: Michael Jamet <michael.jamet@intel.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Yehezkel Bernat <YehezkelShB@gmail.com>
Cc: linux-usb@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/thunderbolt/domain.c | 2 +-
include/linux/thunderbolt.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Comments
On Tue, Dec 19, 2023 at 04:43:05PM +0100, Greg Kroah-Hartman wrote: > 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 <andreas.noever@gmail.com> > Cc: Michael Jamet <michael.jamet@intel.com> > Cc: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Or you want me to pick it up?
On Tue, Dec 19, 2023 at 08:01:02PM +0200, Mika Westerberg wrote: > On Tue, Dec 19, 2023 at 04:43:05PM +0100, Greg Kroah-Hartman wrote: > > 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 <andreas.noever@gmail.com> > > Cc: Michael Jamet <michael.jamet@intel.com> > > Cc: Mika Westerberg <mika.westerberg@linux.intel.com> > > Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> > > Or you want me to pick it up? > I can, thanks! greg k-h
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;