Skip to content

Commit 94ded47

Browse files
kartbennashif
authored andcommitted
drivers: crypto: make driver API and conf structs const
Save precious RAM by making sure driver API and config structs are declared as const Signed-off-by: Benjamin Cabé <[email protected]>
1 parent 0e830b3 commit 94ded47

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

drivers/crypto/crypto_it8xxx2_sha.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ static int it8xxx2_sha_init(const struct device *dev)
215215
return 0;
216216
}
217217

218-
static struct crypto_driver_api it8xxx2_crypto_api = {
218+
static const struct crypto_driver_api it8xxx2_crypto_api = {
219219
.hash_begin_session = it8xxx2_hash_begin_session,
220220
.hash_free_session = it8xxx2_hash_session_free,
221221
.query_hw_caps = it8xxx2_query_hw_caps,

drivers/crypto/crypto_it8xxx2_sha_v2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ static int it8xxx2_sha_init(const struct device *dev)
340340
return 0;
341341
}
342342

343-
static struct crypto_driver_api it8xxx2_crypto_api = {
343+
static const struct crypto_driver_api it8xxx2_crypto_api = {
344344
.hash_begin_session = it8xxx2_hash_begin_session,
345345
.hash_free_session = it8xxx2_hash_session_free,
346346
.query_hw_caps = it8xxx2_query_hw_caps,

drivers/crypto/crypto_mchp_xec_symcr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ static int xec_symcr_init(const struct device *dev)
514514
return ret;
515515
}
516516

517-
static struct crypto_driver_api xec_symcr_api = {
517+
static const struct crypto_driver_api xec_symcr_api = {
518518
.query_hw_caps = xec_symcr_query_hw_caps,
519519
.hash_begin_session = xec_symcr_hash_session_begin,
520520
.hash_free_session = xec_symcr_hash_session_free,

drivers/crypto/crypto_mcux_dcp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ static int crypto_dcp_init(const struct device *dev)
331331
return 0;
332332
}
333333

334-
static struct crypto_driver_api crypto_dcp_api = {
334+
static const struct crypto_driver_api crypto_dcp_api = {
335335
.query_hw_caps = crypto_dcp_query_hw_caps,
336336
.cipher_begin_session = crypto_dcp_cipher_begin_session,
337337
.cipher_free_session = crypto_dcp_cipher_free_session,

drivers/crypto/crypto_npcx_sha.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ static int npcx_hash_init(const struct device *dev)
202202
return 0;
203203
}
204204

205-
static struct crypto_driver_api npcx_crypto_api = {
205+
static const struct crypto_driver_api npcx_crypto_api = {
206206
.hash_begin_session = npcx_hash_session_setup,
207207
.hash_free_session = npcx_hash_session_free,
208208
.query_hw_caps = npcx_query_caps,

drivers/crypto/crypto_smartbond.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ crypto_smartbond_hash_set_async_callback(const struct device *dev, hash_completi
922922
}
923923
#endif
924924

925-
static struct crypto_driver_api crypto_smartbond_driver_api = {
925+
static const struct crypto_driver_api crypto_smartbond_driver_api = {
926926
.cipher_begin_session = crypto_smartbond_cipher_begin_session,
927927
.cipher_free_session = crypto_smartbond_cipher_free_session,
928928
#if defined(CONFIG_CRYPTO_ASYNC)

drivers/crypto/crypto_stm32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ static struct crypto_stm32_data crypto_stm32_dev_data = {
507507
}
508508
};
509509

510-
static struct crypto_stm32_config crypto_stm32_dev_config = {
510+
static const struct crypto_stm32_config crypto_stm32_dev_config = {
511511
.pclken = {
512512
.enr = DT_INST_CLOCKS_CELL(0, bits),
513513
.bus = DT_INST_CLOCKS_CELL(0, bus)

0 commit comments

Comments
 (0)