From patchwork Tue Dec 19 15:47:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181066 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2030473dyi; Tue, 19 Dec 2023 07:48:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IH8lqrAt9S4rZf3Wlagopi/1L43crG6qfMSq5MoQh91JTI5r7mQMIVrClb/82CBHwYZUhFN X-Received: by 2002:ac2:5a4a:0:b0:50e:40a9:c2b5 with SMTP id r10-20020ac25a4a000000b0050e40a9c2b5mr894601lfn.57.1703000899697; Tue, 19 Dec 2023 07:48:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703000899; cv=none; d=google.com; s=arc-20160816; b=zxBv0QJOK3+hiV5yVrrvOa2piZZ97czzrxeEPBLIp4zn3K88wkIC07+rYiUyxrhU00 3Glv+/7aDwnl/UWc6uGDbkf/RBhddctC85P0NosSQJ5kMdy+Kt/lvNTos8Ra/On0lU9o 9lpWYhFL3z93QddTxysPR0LJIKjz7++sL32LZQRkhcKwvKzPj+K7SJl6zpPeE3hDpHiv I8DVNVEaSgYrt1VIz7MidPQmTFGjlYDtJFiergPQKjWF7jWzJHMrGvM/gv4sW2BxGSwK HkMOD3GkbQWDM06Cvw84wrt8jvgwpTItd/krxm8sjdWi1qtt5jku7K1s/h1le/GjfMOH K+cA== 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=WYAoSUAnEikx1arqpbNb/qT6wf+fsiOPCXCtbALDuuc=; fh=iMc6xH8O6u+a52UK9htI4IoBlmsqUxYdlDwpM8Vb6Jk=; b=LCAaH8lTiN5c9iDU5TWdciJbT7TZVgx6qprr1bCYro3KbNNPkjNdNaBuPeQciP/s51 z7jqim65pRRWxyP9RMEF5qsGtUKkrYu2l0l7yr1BuXzGuS9mtzw777+wJq7T05Xl2H8t bkW0nETlhfsr1N5FMGP88S0YRBouPG3vgcgtsfFQCdo62Q74f3f9jLWMWyA0pjTXtIju ZGRmE8xeWFVhapVYP/6s/X55zDRs3FkSriAL+Zl+KJkPihdEddJnoXZSj/qStY1QON5C d9PKs0OEoz5csN4kR39Cq8ZdpfWpFT9KCyXySrAYtsl9jNUBDY3afJewXeatry57DnaF pPTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="bGZ6s/uI"; spf=pass (google.com: domain of linux-kernel+bounces-5513-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5513-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 lf7-20020a170906ae4700b00a2360f73bf5si1515055ejb.2.2023.12.19.07.48.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 07:48:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5513-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="bGZ6s/uI"; spf=pass (google.com: domain of linux-kernel+bounces-5513-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5513-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 2D7121F22308 for ; Tue, 19 Dec 2023 15:48:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 174A4200C3; Tue, 19 Dec 2023 15:47:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="bGZ6s/uI" 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 A9E9E1D529 for ; Tue, 19 Dec 2023 15:47:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08150C433C8; Tue, 19 Dec 2023 15:47:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1703000864; bh=vD7Qje2e5zx74+SAAnwR4GIvB/r8Tg9rSRMD9k+r2n8=; h=From:To:Cc:Subject:Date:From; b=bGZ6s/uITfwIpC2wBycYd81315kAJOgKnV+PoQVeWYlzEOQWtGy0ebzxc4b+JIulQ VZPUqeMh+S0IFwbsaoaXphTzPC+ZRvQUueW2OujHCpylw6gCnoL4/oYrJ+avrEVQPb vY+G6DJP8FNxQnNItooFF125r+nhBSJC7N3QTLt4= From: Greg Kroah-Hartman To: fthain@linux-m68k.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , linux-m68k@lists.linux-m68k.org Subject: [PATCH] nubus: make nubus_bus_type static and constant Date: Tue, 19 Dec 2023 16:47:41 +0100 Message-ID: <2023121940-enlarged-editor-c9a8@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: 48 X-Developer-Signature: v=1; a=openpgp-sha256; l=1588; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=vD7Qje2e5zx74+SAAnwR4GIvB/r8Tg9rSRMD9k+r2n8=; b=owGbwMvMwCRo6H6F97bub03G02pJDKmNu2Um72RyuhtcOCvvxJZyfvOORXsW+n1/qbNx6pUf7 wsdvFRPd8SyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEZBwYFmz/tMGYq/9GTWPm yTPn+9Z9iQn5tIdhfvizhkK3NM97D5fHBYnu+v96x6sF5wA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785725871526371199 X-GMAIL-MSGID: 1785725871526371199 Now that the driver core can properly handle constant struct bus_type, move the nubus_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. It's also never used outside of drivers/nubus/bus.c so make it static and don't export it as no one is using it. Cc: Finn Thain Cc: linux-m68k@lists.linux-m68k.org Signed-off-by: Greg Kroah-Hartman Acked-by: Finn Thain Reviewed-by: Geert Uytterhoeven --- drivers/nubus/bus.c | 3 +-- include/linux/nubus.h | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/nubus/bus.c b/drivers/nubus/bus.c index 72921e4f35f6..12df4d88970c 100644 --- a/drivers/nubus/bus.c +++ b/drivers/nubus/bus.c @@ -32,12 +32,11 @@ static void nubus_device_remove(struct device *dev) ndrv->remove(to_nubus_board(dev)); } -struct bus_type nubus_bus_type = { +static const struct bus_type nubus_bus_type = { .name = "nubus", .probe = nubus_device_probe, .remove = nubus_device_remove, }; -EXPORT_SYMBOL(nubus_bus_type); int nubus_driver_register(struct nubus_driver *ndrv) { diff --git a/include/linux/nubus.h b/include/linux/nubus.h index bdcd85e622d8..4d103ac8f5c7 100644 --- a/include/linux/nubus.h +++ b/include/linux/nubus.h @@ -89,8 +89,6 @@ struct nubus_driver { void (*remove)(struct nubus_board *board); }; -extern struct bus_type nubus_bus_type; - /* Generic NuBus interface functions, modelled after the PCI interface */ #ifdef CONFIG_PROC_FS extern bool nubus_populate_procfs;