git: 47c887be4af7 - main - Revert "mlx4: Move DEFINE_MUTEX() outside function body."

From: Hans Petter Selasky <hselasky_at_FreeBSD.org>
Date: Mon, 22 May 2023 10:55:06 UTC
The branch main has been updated by hselasky:

URL: https://cgit.FreeBSD.org/src/commit/?id=47c887be4af7553a3fae05009516a904dfa2617e

commit 47c887be4af7553a3fae05009516a904dfa2617e
Author:     Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2023-05-22 10:52:10 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2023-05-22 10:53:38 +0000

    Revert "mlx4: Move DEFINE_MUTEX() outside function body."
    
    Requested by:   jrtc27@
    
    This reverts commit 805d759338a2be939fffc8bf3f25cfaab981a9be.
---
 sys/dev/mlx4/mlx4_core/mlx4_main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sys/dev/mlx4/mlx4_core/mlx4_main.c b/sys/dev/mlx4/mlx4_core/mlx4_main.c
index a37b900a2ed0..ca63d1d12ba6 100644
--- a/sys/dev/mlx4/mlx4_core/mlx4_main.c
+++ b/sys/dev/mlx4/mlx4_core/mlx4_main.c
@@ -1164,8 +1164,6 @@ err_sup:
 	return err;
 }
 
-static DEFINE_MUTEX(set_port_type_mutex);
-
 static ssize_t set_port_type(struct device *dev,
 			     struct device_attribute *attr,
 			     const char *buf, size_t count)
@@ -1174,6 +1172,7 @@ static ssize_t set_port_type(struct device *dev,
 						   port_attr);
 	struct mlx4_dev *mdev = info->dev;
 	enum mlx4_port_type port_type;
+	static DEFINE_MUTEX(set_port_type_mutex);
 	int err;
 
 	mutex_lock(&set_port_type_mutex);