tpm: make const pointer desc a static const array
Subsystems (3)
PATCH 1/1 tpm: make const pointer desc a static const array
Make const pointer desc a static const array, removes a dereference and shrinks object code a few bytes.
Signed-off-by Colin Ian King <[email protected]>
--- drivers/char/tpm/tpm_tis_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm_tis_core.c +1 -1
@@ -716,7 +716,7 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id)static int tpm_tis_gen_interrupt (struct tpm_chip *chip) { -const char *desc ="attempting to generate an interrupt" ; +static const char desc[] ="attempting to generate an interrupt" ;u32 cap2;cap_t cap;int ret;
Signature · 1 line
2.33.1
Jarkko Sakkinen
maintainerQuoted 13 lines · Colin Ian King
Make const pointer desc a static const array, removes a dereference and shrinks object code a few bytes.
Signed-off-by Colin Ian King <[email protected]>---
drivers/char/tpm/tpm_tis_core.c | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/char/tpm/tpm_tis_core.c +0
-0@@ -716,7 +716,7 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id)
Quoted 8 lines
static inttpm_tis_gen_interrupt(struct tpm_chip *chip)
{
- const char *desc = "attempting to generate an interrupt"; + static const char desc[] = "attempting to generate an interrupt"; u32 cap2;
cap_t cap;
int ret;
I'd rather go for:
#define TPM_TIS_GEN_INTERRUPT_DESC "attempting to generate an interrupt"
/Jarkko