lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240909-fix_amba-v1-2-4658eed26906@quicinc.com>
Date: Mon, 09 Sep 2024 07:37:33 +0800
From: Zijun Hu <zijun_hu@...oud.com>
To: Russell King <linux@...linux.org.uk>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>, 
 Saravana Kannan <saravanak@...gle.com>, 
 Isaac Manjarres <isaacmanjarres@...gle.com>, 
 Lu Baolu <baolu.lu@...ux.intel.com>, Zijun Hu <zijun_hu@...oud.com>, 
 linux-kernel@...r.kernel.org, Zijun Hu <quic_zijuhu@...cinc.com>
Subject: [PATCH RFC 2/3] amba: bus: Move empty @amba_proxy_drv's definition
 to the front

From: Zijun Hu <quic_zijuhu@...cinc.com>

Move empty @amba_proxy_drv's definition to the front in preparation for
referring to it without forward declaration.

Signed-off-by: Zijun Hu <quic_zijuhu@...cinc.com>
---
 drivers/amba/bus.c | 72 +++++++++++++++++++++++++++---------------------------
 1 file changed, 36 insertions(+), 36 deletions(-)

diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index cc3c57f83798..033d626aff46 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -205,6 +205,42 @@ static int amba_read_periphid(struct amba_device *dev)
 	return ret;
 }
 
+static int amba_proxy_probe(struct amba_device *adev,
+			    const struct amba_id *id)
+{
+	WARN(1, "Stub driver should never match any device.\n");
+	return -ENODEV;
+}
+
+static const struct amba_id amba_stub_drv_ids[] = {
+	{ 0, 0 },
+};
+
+static struct amba_driver amba_proxy_drv = {
+	.drv = {
+		.name = "amba-proxy",
+	},
+	.probe = amba_proxy_probe,
+	.id_table = amba_stub_drv_ids,
+};
+
+static int __init amba_stub_drv_init(void)
+{
+	if (!IS_ENABLED(CONFIG_MODULES))
+		return 0;
+
+	/*
+	 * The amba_match() function will get called only if there is at least
+	 * one amba driver registered. If all amba drivers are modules and are
+	 * only loaded based on uevents, then we'll hit a chicken-and-egg
+	 * situation where amba_match() is waiting on drivers and drivers are
+	 * waiting on amba_match(). So, register a stub driver to make sure
+	 * amba_match() is called even if no amba driver has been registered.
+	 */
+	return __amba_driver_register(&amba_proxy_drv, NULL);
+}
+late_initcall_sync(amba_stub_drv_init);
+
 static int amba_match(struct device *dev, const struct device_driver *drv)
 {
 	struct amba_device *pcdev = to_amba_device(dev);
@@ -456,42 +492,6 @@ static int __init amba_init(void)
 
 postcore_initcall(amba_init);
 
-static int amba_proxy_probe(struct amba_device *adev,
-			    const struct amba_id *id)
-{
-	WARN(1, "Stub driver should never match any device.\n");
-	return -ENODEV;
-}
-
-static const struct amba_id amba_stub_drv_ids[] = {
-	{ 0, 0 },
-};
-
-static struct amba_driver amba_proxy_drv = {
-	.drv = {
-		.name = "amba-proxy",
-	},
-	.probe = amba_proxy_probe,
-	.id_table = amba_stub_drv_ids,
-};
-
-static int __init amba_stub_drv_init(void)
-{
-	if (!IS_ENABLED(CONFIG_MODULES))
-		return 0;
-
-	/*
-	 * The amba_match() function will get called only if there is at least
-	 * one amba driver registered. If all amba drivers are modules and are
-	 * only loaded based on uevents, then we'll hit a chicken-and-egg
-	 * situation where amba_match() is waiting on drivers and drivers are
-	 * waiting on amba_match(). So, register a stub driver to make sure
-	 * amba_match() is called even if no amba driver has been registered.
-	 */
-	return __amba_driver_register(&amba_proxy_drv, NULL);
-}
-late_initcall_sync(amba_stub_drv_init);
-
 /**
  *	__amba_driver_register - register an AMBA device driver
  *	@drv: amba device driver structure

-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ