Commit a9966b580a3e9d7cf820b5360b574f439d813ef4

Authored by Dmitry Eremin-Solenikov
1 parent e9cf356c0c

ieee802154: constify struct net_device in some operations

Some of ieee802154 operations really shouldn't change passed net_device.
Constify passed argument.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>

Showing 2 changed files with 9 additions and 9 deletions Side-by-side Diff

drivers/ieee802154/fakehard.c
... ... @@ -43,7 +43,7 @@
43 43 *
44 44 * Return the ID of the PAN from the PIB.
45 45 */
46   -static u16 fake_get_pan_id(struct net_device *dev)
  46 +static u16 fake_get_pan_id(const struct net_device *dev)
47 47 {
48 48 BUG_ON(dev->type != ARPHRD_IEEE802154);
49 49  
... ... @@ -58,7 +58,7 @@
58 58 * device. If the device has not yet had a short address assigned
59 59 * then this should return 0xFFFF to indicate a lack of association.
60 60 */
61   -static u16 fake_get_short_addr(struct net_device *dev)
  61 +static u16 fake_get_short_addr(const struct net_device *dev)
62 62 {
63 63 BUG_ON(dev->type != ARPHRD_IEEE802154);
64 64  
... ... @@ -78,7 +78,7 @@
78 78 * Note: This is in section 7.2.1.2 of the IEEE 802.15.4-2006
79 79 * document.
80 80 */
81   -static u8 fake_get_dsn(struct net_device *dev)
  81 +static u8 fake_get_dsn(const struct net_device *dev)
82 82 {
83 83 BUG_ON(dev->type != ARPHRD_IEEE802154);
84 84  
... ... @@ -98,7 +98,7 @@
98 98 * Note: This is in section 7.2.1.2 of the IEEE 802.15.4-2006
99 99 * document.
100 100 */
101   -static u8 fake_get_bsn(struct net_device *dev)
  101 +static u8 fake_get_bsn(const struct net_device *dev)
102 102 {
103 103 BUG_ON(dev->type != ARPHRD_IEEE802154);
104 104  
include/net/ieee802154_netdev.h
... ... @@ -98,14 +98,14 @@
98 98 * FIXME: these should become the part of PIB/MIB interface.
99 99 * However we still don't have IB interface of any kind
100 100 */
101   - u16 (*get_pan_id)(struct net_device *dev);
102   - u16 (*get_short_addr)(struct net_device *dev);
103   - u8 (*get_dsn)(struct net_device *dev);
104   - u8 (*get_bsn)(struct net_device *dev);
  101 + u16 (*get_pan_id)(const struct net_device *dev);
  102 + u16 (*get_short_addr)(const struct net_device *dev);
  103 + u8 (*get_dsn)(const struct net_device *dev);
  104 + u8 (*get_bsn)(const struct net_device *dev);
105 105 };
106 106  
107 107 static inline struct ieee802154_mlme_ops *ieee802154_mlme_ops(
108   - struct net_device *dev)
  108 + const struct net_device *dev)
109 109 {
110 110 return dev->ml_priv;
111 111 }