From: Alexander Aring <alex.aring@gmail.com>
To: linux-wpan@vger.kernel.org
Cc: kernel@pengutronix.de, Alexander Aring <alex.aring@gmail.com>,
Alan Ott <alan@signal11.us>
Subject: [PATCH bluetooth-next 03/17] mac802154: declare struct ieee802154_ops as const
Date: Tue, 28 Oct 2014 18:21:18 +0100 [thread overview]
Message-ID: <1414516892-4107-4-git-send-email-alex.aring@gmail.com> (raw)
In-Reply-To: <1414516892-4107-1-git-send-email-alex.aring@gmail.com>
The ieee802154_ops structure should be never changed during runtime.
This patch declare this structure as const to avoid a runtime change.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Cc: Alan Ott <alan@signal11.us>
---
drivers/net/ieee802154/at86rf230.c | 2 +-
drivers/net/ieee802154/cc2520.c | 2 +-
drivers/net/ieee802154/fakelb.c | 2 +-
drivers/net/ieee802154/mrf24j40.c | 2 +-
include/net/mac802154.h | 2 +-
net/mac802154/ieee802154_i.h | 2 +-
net/mac802154/main.c | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index a155838..662efd3 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -1214,7 +1214,7 @@ at86rf230_set_frame_retries(struct ieee802154_hw *hw, s8 retries)
return rc;
}
-static struct ieee802154_ops at86rf230_ops = {
+static const struct ieee802154_ops at86rf230_ops = {
.owner = THIS_MODULE,
.xmit_async = at86rf230_xmit,
.ed = at86rf230_ed,
diff --git a/drivers/net/ieee802154/cc2520.c b/drivers/net/ieee802154/cc2520.c
index a31b5b6..b479c9d 100644
--- a/drivers/net/ieee802154/cc2520.c
+++ b/drivers/net/ieee802154/cc2520.c
@@ -631,7 +631,7 @@ cc2520_filter(struct ieee802154_hw *hw,
return 0;
}
-static struct ieee802154_ops cc2520_ops = {
+static const struct ieee802154_ops cc2520_ops = {
.owner = THIS_MODULE,
.start = cc2520_start,
.stop = cc2520_stop,
diff --git a/drivers/net/ieee802154/fakelb.c b/drivers/net/ieee802154/fakelb.c
index db0703f..2a97cbb 100644
--- a/drivers/net/ieee802154/fakelb.c
+++ b/drivers/net/ieee802154/fakelb.c
@@ -129,7 +129,7 @@ fakelb_hw_stop(struct ieee802154_hw *hw) {
spin_unlock(&priv->lock);
}
-static struct ieee802154_ops fakelb_ops = {
+static const struct ieee802154_ops fakelb_ops = {
.owner = THIS_MODULE,
.xmit_sync = fakelb_hw_xmit,
.ed = fakelb_hw_ed,
diff --git a/drivers/net/ieee802154/mrf24j40.c b/drivers/net/ieee802154/mrf24j40.c
index 7abb237..f19cf58 100644
--- a/drivers/net/ieee802154/mrf24j40.c
+++ b/drivers/net/ieee802154/mrf24j40.c
@@ -579,7 +579,7 @@ out:
return ret;
}
-static struct ieee802154_ops mrf24j40_ops = {
+static const struct ieee802154_ops mrf24j40_ops = {
.owner = THIS_MODULE,
.xmit_sync = mrf24j40_tx,
.ed = mrf24j40_ed,
diff --git a/include/net/mac802154.h b/include/net/mac802154.h
index 4c4642e..0ea44cd 100644
--- a/include/net/mac802154.h
+++ b/include/net/mac802154.h
@@ -197,7 +197,7 @@ struct ieee802154_ops {
/* Basic interface to register ieee802154 hwice */
struct ieee802154_hw *
-ieee802154_alloc_hw(size_t priv_data_len, struct ieee802154_ops *ops);
+ieee802154_alloc_hw(size_t priv_data_len, const struct ieee802154_ops *ops);
void ieee802154_free_hw(struct ieee802154_hw *hw);
int ieee802154_register_hw(struct ieee802154_hw *hw);
void ieee802154_unregister_hw(struct ieee802154_hw *hw);
diff --git a/net/mac802154/ieee802154_i.h b/net/mac802154/ieee802154_i.h
index 4408c46..a379b97 100644
--- a/net/mac802154/ieee802154_i.h
+++ b/net/mac802154/ieee802154_i.h
@@ -28,7 +28,7 @@
/* mac802154 device private data */
struct ieee802154_local {
struct ieee802154_hw hw;
- struct ieee802154_ops *ops;
+ const struct ieee802154_ops *ops;
/* ieee802154 phy */
struct wpan_phy *phy;
diff --git a/net/mac802154/main.c b/net/mac802154/main.c
index 2c6d772..632707b 100644
--- a/net/mac802154/main.c
+++ b/net/mac802154/main.c
@@ -187,7 +187,7 @@ static void ieee802154_tasklet_handler(unsigned long data)
}
struct ieee802154_hw *
-ieee802154_alloc_hw(size_t priv_data_len, struct ieee802154_ops *ops)
+ieee802154_alloc_hw(size_t priv_data_len, const struct ieee802154_ops *ops)
{
struct wpan_phy *phy;
struct ieee802154_local *local;
--
2.1.2
next prev parent reply other threads:[~2014-10-28 17:21 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-28 17:21 [PATCH bluetooth-next 00/17] mac802154: iface and driver-ops cleanup Alexander Aring
2014-10-28 17:21 ` [PATCH bluetooth-next 01/17] mac802154: monitor: merge into iface implementation Alexander Aring
2014-10-29 3:39 ` Varka Bhadram
2014-10-29 3:49 ` Varka Bhadram
2014-10-29 5:39 ` Alexander Aring
2014-10-28 17:21 ` [PATCH bluetooth-next 02/17] mac802154: main: move open and close into iface Alexander Aring
2014-10-28 17:21 ` Alexander Aring [this message]
2014-10-29 3:31 ` [PATCH bluetooth-next 03/17] mac802154: declare struct ieee802154_ops as const Varka Bhadram
2014-10-28 17:21 ` [PATCH bluetooth-next 04/17] mac802154: ops: declare channel and page as u8 Alexander Aring
2014-10-29 3:32 ` Varka Bhadram
2014-10-28 17:21 ` [PATCH bluetooth-next 05/17] mac802154: introduce driver-ops header Alexander Aring
2014-10-28 17:21 ` [PATCH bluetooth-next 06/17] mac802154: use driver-ops function wrappers Alexander Aring
2014-10-28 17:21 ` [PATCH bluetooth-next 07/17] mac802154: remove might_sleep from driver layer Alexander Aring
2014-10-29 3:33 ` Varka Bhadram
2014-10-29 5:53 ` Alexander Aring
2014-10-29 5:57 ` Varka Bhadram
2014-10-29 6:13 ` Alexander Aring
2014-10-29 7:23 ` Alexander Aring
2014-10-29 8:10 ` Varka Bhadram
2014-10-29 8:12 ` Varka Bhadram
2014-10-28 17:21 ` [PATCH bluetooth-next 08/17] mac802154: remove driver ops in wpan-phy Alexander Aring
2014-10-28 17:21 ` [PATCH bluetooth-next 09/17] mac802154: rework sdata state change to running Alexander Aring
2014-10-28 17:21 ` [PATCH bluetooth-next 10/17] mac802154: rename running to started Alexander Aring
2014-10-28 17:21 ` [PATCH bluetooth-next 11/17] mac802154: move local started handling Alexander Aring
2014-10-28 17:21 ` [PATCH bluetooth-next 12/17] mac802154: add synchronization handling Alexander Aring
2014-10-28 17:21 ` [PATCH bluetooth-next 13/17] mac802154: iface: remove assign to zero Alexander Aring
2014-10-28 17:21 ` [PATCH bluetooth-next 14/17] mac802154: remove channel attributes from sdata Alexander Aring
2014-10-29 3:52 ` Varka Bhadram
2014-10-29 5:22 ` Alexander Aring
2014-10-29 5:35 ` Varka Bhadram
2014-10-29 6:07 ` Alexander Aring
2014-10-28 17:21 ` [PATCH bluetooth-next 15/17] mac802154: move mac_params functions into mac_cmd Alexander Aring
2014-10-28 17:21 ` [PATCH bluetooth-next 16/17] mac802154: cleanup open count handling Alexander Aring
2014-10-28 17:21 ` [PATCH bluetooth-next 17/17] ieee802154: introduce sysfs file Alexander Aring
2014-10-28 22:24 ` [PATCH bluetooth-next 00/17] mac802154: iface and driver-ops cleanup Marcel Holtmann
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=1414516892-4107-4-git-send-email-alex.aring@gmail.com \
--to=alex.aring@gmail.com \
--cc=alan@signal11.us \
--cc=kernel@pengutronix.de \
--cc=linux-wpan@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox