Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

efi: stmm: Constify struct efivar_operations

The 'struct efivar_operations' is not modified by the driver after
initialization, so it should follow typical practice of being static
const for increased code safety and readability.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Ard Biesheuvel
62cb7abd e00ac9e5

+9 -8
+9 -8
drivers/firmware/efi/stmm/tee_stmm_efi.c
··· 14 14 #include "mm_communication.h" 15 15 16 16 static struct efivars tee_efivars; 17 - static struct efivar_operations tee_efivar_ops; 18 17 19 18 static size_t max_buffer_size; /* comm + var + func + data */ 20 19 static size_t max_payload_size; /* func + data */ ··· 519 520 efivars_generic_ops_register(); 520 521 } 521 522 523 + static const struct efivar_operations tee_efivar_ops = { 524 + .get_variable = tee_get_variable, 525 + .get_next_variable = tee_get_next_variable, 526 + .set_variable = tee_set_variable, 527 + .set_variable_nonblocking = tee_set_variable_nonblocking, 528 + .query_variable_store = efi_query_variable_store, 529 + .query_variable_info = tee_query_variable_info, 530 + }; 531 + 522 532 static int tee_stmm_efi_probe(struct tee_client_device *tee_dev) 523 533 { 524 534 struct device *dev = &tee_dev->dev; ··· 565 557 max_buffer_size = MM_COMMUNICATE_HEADER_SIZE + 566 558 MM_VARIABLE_COMMUNICATE_SIZE + 567 559 max_payload_size; 568 - 569 - tee_efivar_ops.get_variable = tee_get_variable; 570 - tee_efivar_ops.get_next_variable = tee_get_next_variable; 571 - tee_efivar_ops.set_variable = tee_set_variable; 572 - tee_efivar_ops.set_variable_nonblocking = tee_set_variable_nonblocking; 573 - tee_efivar_ops.query_variable_store = efi_query_variable_store; 574 - tee_efivar_ops.query_variable_info = tee_query_variable_info; 575 560 576 561 efivars_generic_ops_unregister(); 577 562 pr_info("Using TEE-based EFI runtime variable services\n");