[PATCH] Bluetooth: btintel: Constify static struct regmap_bus

Rikard Falkeborn posted 1 patch 4 years, 2 months ago
drivers/bluetooth/btintel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] Bluetooth: btintel: Constify static struct regmap_bus
Posted by Rikard Falkeborn 4 years, 2 months ago
The only usage of regmap_ibt is to (after the regmap_init() macro is
expanded), pass its address to __regmap_init(), which takes a pointer to
const struct regmap_bus as input. Make it const to allow the compiler to
put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/bluetooth/btintel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c
index 06514ed66022..818681c89db8 100644
--- a/drivers/bluetooth/btintel.c
+++ b/drivers/bluetooth/btintel.c
@@ -794,7 +794,7 @@ static void regmap_ibt_free_context(void *context)
 	kfree(context);
 }
 
-static struct regmap_bus regmap_ibt = {
+static const struct regmap_bus regmap_ibt = {
 	.read = regmap_ibt_read,
 	.write = regmap_ibt_write,
 	.gather_write = regmap_ibt_gather_write,
-- 
2.35.1
Re: [PATCH] Bluetooth: btintel: Constify static struct regmap_bus
Posted by patchwork-bot+bluetooth@kernel.org 4 years, 2 months ago
Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Marcel Holtmann <marcel@holtmann.org>:

On Thu, 31 Mar 2022 00:32:52 +0200 you wrote:
> The only usage of regmap_ibt is to (after the regmap_init() macro is
> expanded), pass its address to __regmap_init(), which takes a pointer to
> const struct regmap_bus as input. Make it const to allow the compiler to
> put it in read-only memory.
> 
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
> 
> [...]

Here is the summary with links:
  - Bluetooth: btintel: Constify static struct regmap_bus
    https://git.kernel.org/bluetooth/bluetooth-next/c/30b0001fcdc1

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