All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rikard Falkeborn <rikard.falkeborn@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Loic Poulain <loic.poulain@linaro.org>,
	Wei Yongjun <weiyongjun1@huawei.com>
Cc: Oliver Neukum <oneukum@suse.com>,
	Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	Junlin Yang <yangjunlin@yulong.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Rikard Falkeborn <rikard.falkeborn@gmail.com>
Subject: [PATCH 2/2] usb: cdc-wdm: Constify static struct wwan_port_ops
Date: Wed, 29 Sep 2021 15:21:43 +0200	[thread overview]
Message-ID: <20210929132143.36822-3-rikard.falkeborn@gmail.com> (raw)
In-Reply-To: <20210929132143.36822-1-rikard.falkeborn@gmail.com>

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>
---
 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 03b25aaaa1dd..e5834f1228f9 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


  parent reply	other threads:[~2021-09-29 13:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-29 13:21 [PATCH 0/2] usb: cdc-wdm: Fix config and constify Rikard Falkeborn
2021-09-29 13:21 ` [PATCH 1/2] usb: cdc-wdm: Fix check for WWAN Rikard Falkeborn
2021-09-29 19:38   ` Rikard Falkeborn
2021-09-30  9:06   ` Oliver Neukum
2021-09-29 13:21 ` Rikard Falkeborn [this message]
2021-09-30  9:08   ` [PATCH 2/2] usb: cdc-wdm: Constify static struct wwan_port_ops Oliver Neukum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210929132143.36822-3-rikard.falkeborn@gmail.com \
    --to=rikard.falkeborn@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=loic.poulain@linaro.org \
    --cc=oneukum@suse.com \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=weiyongjun1@huawei.com \
    --cc=yangjunlin@yulong.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.