[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20210929194547.46954-3-rikard.falkeborn@gmail.com>
Date: Wed, 29 Sep 2021 21:45:47 +0200
From: Rikard Falkeborn <rikard.falkeborn@...il.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Loic Poulain <loic.poulain@...aro.org>,
Wei Yongjun <weiyongjun1@...wei.com>
Cc: Oliver Neukum <oneukum@...e.com>,
Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>,
Junlin Yang <yangjunlin@...ong.com>, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org,
Rikard Falkeborn <rikard.falkeborn@...il.com>
Subject: [PATCH V2 2/2] usb: cdc-wdm: Constify static struct wwan_port_ops
The only usage of wdm_wwan_port_ops is to pass its address to
wwan_create_port() which takes a pointer to const wwan_port_ops as
argument. Make it const to allow the compiler to put it in read-only
memory.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@...il.com>
---
Changes:
V1->V2: No changes
drivers/usb/class/cdc-wdm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index fdf79bcf7eb0..7f2c83f299d3 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -911,7 +911,7 @@ static int wdm_wwan_port_tx(struct wwan_port *port, struct sk_buff *skb)
return rv;
}
-static struct wwan_port_ops wdm_wwan_port_ops = {
+static const struct wwan_port_ops wdm_wwan_port_ops = {
.start = wdm_wwan_port_start,
.stop = wdm_wwan_port_stop,
.tx = wdm_wwan_port_tx,
--
2.33.0
Powered by blists - more mailing lists