[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191105151353.6522-2-andrew.smirnov@gmail.com>
Date: Tue, 5 Nov 2019 07:13:49 -0800
From: Andrey Smirnov <andrew.smirnov@...il.com>
To: linux-crypto@...r.kernel.org
Cc: Andrey Smirnov <andrew.smirnov@...il.com>,
Chris Healy <cphealy@...il.com>,
Lucas Stach <l.stach@...gutronix.de>,
Horia Geantă <horia.geanta@....com>,
Herbert Xu <herbert@...dor.apana.org.au>,
Iuliana Prodan <iuliana.prodan@....com>, linux-imx@....com,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/5] crypto: caam - use static initialization
Use static initialization for global variables.
Signed-off-by: Andrey Smirnov <andrew.smirnov@...il.com>
Cc: Chris Healy <cphealy@...il.com>
Cc: Lucas Stach <l.stach@...gutronix.de>
Cc: Horia Geantă <horia.geanta@....com>
Cc: Herbert Xu <herbert@...dor.apana.org.au>
Cc: Iuliana Prodan <iuliana.prodan@....com>
Cc: linux-imx@....com
Cc: linux-crypto@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
---
drivers/crypto/caam/jr.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/crypto/caam/jr.c b/drivers/crypto/caam/jr.c
index fc97cde27059..49c98a7f6723 100644
--- a/drivers/crypto/caam/jr.c
+++ b/drivers/crypto/caam/jr.c
@@ -23,7 +23,10 @@ struct jr_driver_data {
spinlock_t jr_alloc_lock; /* jr_list lock */
} ____cacheline_aligned;
-static struct jr_driver_data driver_data;
+static struct jr_driver_data driver_data = {
+ .jr_list = LIST_HEAD_INIT(driver_data.jr_list),
+ .jr_alloc_lock = __SPIN_LOCK_UNLOCKED(driver_data.jr_alloc_lock),
+};
static DEFINE_MUTEX(algs_lock);
static unsigned int active_devs;
@@ -589,8 +592,6 @@ static struct platform_driver caam_jr_driver = {
static int __init jr_driver_init(void)
{
- spin_lock_init(&driver_data.jr_alloc_lock);
- INIT_LIST_HEAD(&driver_data.jr_list);
return platform_driver_register(&caam_jr_driver);
}
--
2.21.0
Powered by blists - more mailing lists