diff options
author | Miquel Raynal <miquel.raynal@bootlin.com> | 2023-01-30 16:43:06 +0100 |
---|---|---|
committer | Stefan Schmidt <stefan@datenfreihafen.org> | 2023-01-30 17:16:28 +0100 |
commit | 8338304c2719fb7aec8e4b5dd9fa684b719db06e (patch) | |
tree | c363ab01c69289068bf9d318feeeee09f476d82d /net/mac802154 | |
parent | 622bd6ea90086beb98ac439edd7d57de73d1d6f9 (diff) |
mac802154: Avoid superfluous endianness handling
When compiling scan.c with C=1, Sparse complains with:
sparse: expected unsigned short [usertype] val
sparse: got restricted __le16 [usertype] pan_id
sparse: sparse: cast from restricted __le16
sparse: expected unsigned long long [usertype] val
sparse: got restricted __le64 [usertype] extended_addr
sparse: sparse: cast from restricted __le64
The tool is right, both pan_id and extended_addr already are rightfully
defined as being __le16 and __le64 on both sides of the operations and
do not require extra endianness handling.
Fixes: 3accf4762734 ("mac802154: Handle basic beaconing")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/r/20230130154306.114265-1-miquel.raynal@bootlin.com
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
Diffstat (limited to 'net/mac802154')
-rw-r--r-- | net/mac802154/scan.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/mac802154/scan.c b/net/mac802154/scan.c index cfbe20b1ec5e..8f98efec7753 100644 --- a/net/mac802154/scan.c +++ b/net/mac802154/scan.c @@ -419,8 +419,8 @@ int mac802154_send_beacons_locked(struct ieee802154_sub_if_data *sdata, local->beacon.mhr.fc.source_addr_mode = IEEE802154_EXTENDED_ADDRESSING; atomic_set(&request->wpan_dev->bsn, -1); local->beacon.mhr.source.mode = IEEE802154_ADDR_LONG; - local->beacon.mhr.source.pan_id = cpu_to_le16(request->wpan_dev->pan_id); - local->beacon.mhr.source.extended_addr = cpu_to_le64(request->wpan_dev->extended_addr); + local->beacon.mhr.source.pan_id = request->wpan_dev->pan_id; + local->beacon.mhr.source.extended_addr = request->wpan_dev->extended_addr; local->beacon.mac_pl.beacon_order = request->interval; local->beacon.mac_pl.superframe_order = request->interval; local->beacon.mac_pl.final_cap_slot = 0xf; |