diff options
author | Alexander Aring <alex.aring@gmail.com> | 2014-10-28 13:21:18 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-10-28 18:19:07 -0400 |
commit | 16301861004e50be9c47113cceca62f56516a9a2 (patch) | |
tree | 775e43ecec473f9d14cc11bd891aa93d2276ca78 | |
parent | 19ec690a431d8ebf3e9d939160dc223ad40d7d63 (diff) |
mac802154: declare struct ieee802154_ops as const
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>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r-- | drivers/net/ieee802154/at86rf230.c | 2 | ||||
-rw-r--r-- | drivers/net/ieee802154/cc2520.c | 2 | ||||
-rw-r--r-- | drivers/net/ieee802154/fakelb.c | 2 | ||||
-rw-r--r-- | drivers/net/ieee802154/mrf24j40.c | 2 | ||||
-rw-r--r-- | include/net/mac802154.h | 2 | ||||
-rw-r--r-- | net/mac802154/ieee802154_i.h | 2 | ||||
-rw-r--r-- | 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 a1558385bac9..662efd3e07b9 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) | |||
1214 | return rc; | 1214 | return rc; |
1215 | } | 1215 | } |
1216 | 1216 | ||
1217 | static struct ieee802154_ops at86rf230_ops = { | 1217 | static const struct ieee802154_ops at86rf230_ops = { |
1218 | .owner = THIS_MODULE, | 1218 | .owner = THIS_MODULE, |
1219 | .xmit_async = at86rf230_xmit, | 1219 | .xmit_async = at86rf230_xmit, |
1220 | .ed = at86rf230_ed, | 1220 | .ed = at86rf230_ed, |
diff --git a/drivers/net/ieee802154/cc2520.c b/drivers/net/ieee802154/cc2520.c index a31b5b62a353..b479c9d560f8 100644 --- a/drivers/net/ieee802154/cc2520.c +++ b/drivers/net/ieee802154/cc2520.c | |||
@@ -631,7 +631,7 @@ cc2520_filter(struct ieee802154_hw *hw, | |||
631 | return 0; | 631 | return 0; |
632 | } | 632 | } |
633 | 633 | ||
634 | static struct ieee802154_ops cc2520_ops = { | 634 | static const struct ieee802154_ops cc2520_ops = { |
635 | .owner = THIS_MODULE, | 635 | .owner = THIS_MODULE, |
636 | .start = cc2520_start, | 636 | .start = cc2520_start, |
637 | .stop = cc2520_stop, | 637 | .stop = cc2520_stop, |
diff --git a/drivers/net/ieee802154/fakelb.c b/drivers/net/ieee802154/fakelb.c index db0703f0fa41..2a97cbb3aa01 100644 --- a/drivers/net/ieee802154/fakelb.c +++ b/drivers/net/ieee802154/fakelb.c | |||
@@ -129,7 +129,7 @@ fakelb_hw_stop(struct ieee802154_hw *hw) { | |||
129 | spin_unlock(&priv->lock); | 129 | spin_unlock(&priv->lock); |
130 | } | 130 | } |
131 | 131 | ||
132 | static struct ieee802154_ops fakelb_ops = { | 132 | static const struct ieee802154_ops fakelb_ops = { |
133 | .owner = THIS_MODULE, | 133 | .owner = THIS_MODULE, |
134 | .xmit_sync = fakelb_hw_xmit, | 134 | .xmit_sync = fakelb_hw_xmit, |
135 | .ed = fakelb_hw_ed, | 135 | .ed = fakelb_hw_ed, |
diff --git a/drivers/net/ieee802154/mrf24j40.c b/drivers/net/ieee802154/mrf24j40.c index 7abb237cb989..f19cf588de2e 100644 --- a/drivers/net/ieee802154/mrf24j40.c +++ b/drivers/net/ieee802154/mrf24j40.c | |||
@@ -579,7 +579,7 @@ out: | |||
579 | return ret; | 579 | return ret; |
580 | } | 580 | } |
581 | 581 | ||
582 | static struct ieee802154_ops mrf24j40_ops = { | 582 | static const struct ieee802154_ops mrf24j40_ops = { |
583 | .owner = THIS_MODULE, | 583 | .owner = THIS_MODULE, |
584 | .xmit_sync = mrf24j40_tx, | 584 | .xmit_sync = mrf24j40_tx, |
585 | .ed = mrf24j40_ed, | 585 | .ed = mrf24j40_ed, |
diff --git a/include/net/mac802154.h b/include/net/mac802154.h index 4c4642ef244f..0ea44cda2920 100644 --- a/include/net/mac802154.h +++ b/include/net/mac802154.h | |||
@@ -197,7 +197,7 @@ struct ieee802154_ops { | |||
197 | 197 | ||
198 | /* Basic interface to register ieee802154 hwice */ | 198 | /* Basic interface to register ieee802154 hwice */ |
199 | struct ieee802154_hw * | 199 | struct ieee802154_hw * |
200 | ieee802154_alloc_hw(size_t priv_data_len, struct ieee802154_ops *ops); | 200 | ieee802154_alloc_hw(size_t priv_data_len, const struct ieee802154_ops *ops); |
201 | void ieee802154_free_hw(struct ieee802154_hw *hw); | 201 | void ieee802154_free_hw(struct ieee802154_hw *hw); |
202 | int ieee802154_register_hw(struct ieee802154_hw *hw); | 202 | int ieee802154_register_hw(struct ieee802154_hw *hw); |
203 | void ieee802154_unregister_hw(struct ieee802154_hw *hw); | 203 | void ieee802154_unregister_hw(struct ieee802154_hw *hw); |
diff --git a/net/mac802154/ieee802154_i.h b/net/mac802154/ieee802154_i.h index 4408c463af35..a379b971b13c 100644 --- a/net/mac802154/ieee802154_i.h +++ b/net/mac802154/ieee802154_i.h | |||
@@ -28,7 +28,7 @@ | |||
28 | /* mac802154 device private data */ | 28 | /* mac802154 device private data */ |
29 | struct ieee802154_local { | 29 | struct ieee802154_local { |
30 | struct ieee802154_hw hw; | 30 | struct ieee802154_hw hw; |
31 | struct ieee802154_ops *ops; | 31 | const struct ieee802154_ops *ops; |
32 | 32 | ||
33 | /* ieee802154 phy */ | 33 | /* ieee802154 phy */ |
34 | struct wpan_phy *phy; | 34 | struct wpan_phy *phy; |
diff --git a/net/mac802154/main.c b/net/mac802154/main.c index 2c6d77259822..632707bc47b9 100644 --- a/net/mac802154/main.c +++ b/net/mac802154/main.c | |||
@@ -187,7 +187,7 @@ static void ieee802154_tasklet_handler(unsigned long data) | |||
187 | } | 187 | } |
188 | 188 | ||
189 | struct ieee802154_hw * | 189 | struct ieee802154_hw * |
190 | ieee802154_alloc_hw(size_t priv_data_len, struct ieee802154_ops *ops) | 190 | ieee802154_alloc_hw(size_t priv_data_len, const struct ieee802154_ops *ops) |
191 | { | 191 | { |
192 | struct wpan_phy *phy; | 192 | struct wpan_phy *phy; |
193 | struct ieee802154_local *local; | 193 | struct ieee802154_local *local; |