nfc: pn544: make array rset_cmd static const
Subsystems (4)
PATCH 1/1 nfc: pn544: make array rset_cmd static const
Don't populate the read-only array rset_cmd on the stack but instead it static const. Also makes the object code a little smaller.
Signed-off-by Colin Ian King <[email protected]>
--- drivers/nfc/pn544/i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nfc/pn544/i2c.c +1 -1
@@ -188,7 +188,7 @@ do { \static void pn544_hci_i2c_platform_init (struct pn544_i2c_phy *phy) {int polarity, retry, ret; -char rset_cmd[] = {0x05 ,0xF9 ,0x04 ,0x00 ,0xC3 ,0xE5 }; +static const char rset_cmd[] = {0x05 ,0xF9 ,0x04 ,0x00 ,0xC3 ,0xE5 };int count =sizeof (rset_cmd);nfc_info (&phy->i2c_dev->dev,"Detecting nfc_en polarity\n" );
Signature · 1 line
2.32.0
Quoted 8 lines · Colin Ian King
Don't populate the read-only array
rset_cmdon the stack but instead it static const. Also makes the object code a little smaller.Signed-off-by Colin Ian King <[email protected]>--- drivers/nfc/pn544/i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by Krzysztof Kozlowski <[email protected]>
Best regards,
Krzysztof
This patch was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (master)
by Jakub Kicinski <[email protected]>:
Quoted 7 lines · On Sun, 9 Jan 2022 20:24:18 +0000 you wrote:
Don't populate the read-only array
rset_cmdon the stack but instead it static const. Also makes the object code a little smaller.Signed-off-by Colin Ian King <[email protected]>--- drivers/nfc/pn544/i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- nfc: pn544: make array rset_cmd static const
https://git.kernel.org/netdev/net/c/e110978d6e06
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html