usb: cdc-wdm: Constify static struct wwan_port_ops
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Wed, 29 Sep 2021 19:45:47 +0000 (21:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Oct 2021 10:58:17 +0000 (12:58 +0200)
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@gmail.com>
Acked-by: Oliver Neukum <oneukum@suse.com>
Link: https://lore.kernel.org/r/20210929194547.46954-3-rikard.falkeborn@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/class/cdc-wdm.c

index 35d5908b5478aad688d6ddae66b72c8d3377ab4d..3896656a9b6e3e0a4d608990bc973d7e6838f8e8 100644 (file)
@@ -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,