2021-10-06 22:52:16

by Rikard Falkeborn

[permalink] [raw]
Subject: [PATCH 0/2] nfc: pn533: Constify ops-structs

Constify a couple of ops-structs. This allows the compiler to put the
static structs in read-only memory.

Rikard Falkeborn (2):
nfc: pn533: Constify serdev_device_ops
nfc: pn533: Constify pn533_phy_ops

drivers/nfc/pn533/i2c.c | 2 +-
drivers/nfc/pn533/pn533.c | 2 +-
drivers/nfc/pn533/pn533.h | 4 ++--
drivers/nfc/pn533/uart.c | 4 ++--
drivers/nfc/pn533/usb.c | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)

--
2.33.0


2021-10-06 23:07:24

by Rikard Falkeborn

[permalink] [raw]
Subject: [PATCH 1/2] nfc: pn533: Constify serdev_device_ops

The only usage of pn532_serdev_ops is to pass its address to
serdev_device_set_client_ops(), which takes a pointer to const
serdev_device_ops as argument. Make it const to allow the compiler to
put it in read-only memory.

Signed-off-by: Rikard Falkeborn <[email protected]>
---
drivers/nfc/pn533/uart.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nfc/pn533/uart.c b/drivers/nfc/pn533/uart.c
index 7bdaf8263070..77bb073f031a 100644
--- a/drivers/nfc/pn533/uart.c
+++ b/drivers/nfc/pn533/uart.c
@@ -224,7 +224,7 @@ static int pn532_receive_buf(struct serdev_device *serdev,
return i;
}

-static struct serdev_device_ops pn532_serdev_ops = {
+static const struct serdev_device_ops pn532_serdev_ops = {
.receive_buf = pn532_receive_buf,
.write_wakeup = serdev_device_write_wakeup,
};
--
2.33.0

2021-10-07 12:43:11

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH 0/2] nfc: pn533: Constify ops-structs

Hello:

This series was applied to netdev/net-next.git (refs/heads/master)
by David S. Miller <[email protected]>:

On Thu, 7 Oct 2021 00:47:36 +0200 you wrote:
> Constify a couple of ops-structs. This allows the compiler to put the
> static structs in read-only memory.
>
> Rikard Falkeborn (2):
> nfc: pn533: Constify serdev_device_ops
> nfc: pn533: Constify pn533_phy_ops
>
> [...]

Here is the summary with links:
- [1/2] nfc: pn533: Constify serdev_device_ops
https://git.kernel.org/netdev/net-next/c/be5f60d8b6f9
- [2/2] nfc: pn533: Constify pn533_phy_ops
https://git.kernel.org/netdev/net-next/c/bc642817b6d9

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html