Skip to contentSkip to conversation

cw1200: add const to hwbus_ops structures

PATCH In review Bhumika Goyal 2 participants 2 messages Jun 23, 2017 – Jun 28, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cw1200: add const to hwbus_ops structures

Declare hwbus_ops structures as const as they are only passed as an argument to the function cw1200_core_probe. This argument is of type const. So, make these structures const.

---
 drivers/net/wireless/st/cw1200/cw1200_sdio.c | 2 +-
 drivers/net/wireless/st/cw1200/cw1200_spi.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/st/cw1200/cw1200_sdio.c +1 -1
index 709f56e..1037ec6 100644
@@ -266,7 +266,7 @@ static int cw1200_sdio_pm(struct hwbus_priv *self, bool suspend)
 	return ret;
 }
 
-static struct hwbus_ops cw1200_sdio_hwbus_ops = {
+static const struct hwbus_ops cw1200_sdio_hwbus_ops = {
 	.hwbus_memcpy_fromio	= cw1200_sdio_memcpy_fromio,
 	.hwbus_memcpy_toio	= cw1200_sdio_memcpy_toio,
 	.lock			= cw1200_sdio_lock,
drivers/net/wireless/st/cw1200/cw1200_spi.c +1 -1
index 63f95e9..412fb6e4 100644
@@ -352,7 +352,7 @@ static int cw1200_spi_pm(struct hwbus_priv *self, bool suspend)
 	return irq_set_irq_wake(self->func->irq, suspend);
 }
 
-static struct hwbus_ops cw1200_spi_hwbus_ops = {
+static const struct hwbus_ops cw1200_spi_hwbus_ops = {
 	.hwbus_memcpy_fromio	= cw1200_spi_memcpy_fromio,
 	.hwbus_memcpy_toio	= cw1200_spi_memcpy_toio,
 	.lock			= cw1200_spi_lock,
Signature · 1 line
2.7.4
#1 lore raw
Quoted 5 lines · Bhumika Goyal

Declare hwbus_ops structures as const as they are only passed as an argument to the function cw1200_core_probe. This argument is of type const. So, make these structures const.

Patch applied to wireless-drivers-next.git, thanks.

3ac27dd37b40 cw1200: add const to hwbus_ops structures

Signature · 3 lines
https://patchwork.kernel.org/patch/9806289/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches