Commit ae7245cbf27ee6b6423bc363cbe01c93e57befda

Authored by Harvey Harrison
Committed by John W. Linville
1 parent 5a433b3ad4

wireless: use get/put_unaligned_* helpers

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

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

net/mac80211/mesh_hwmp.c
... ... @@ -26,7 +26,7 @@
26 26 {
27 27 if (ae)
28 28 offset += 6;
29   - return le32_to_cpu(get_unaligned((__le32 *) (preq_elem + offset)));
  29 + return get_unaligned_le32(preq_elem + offset);
30 30 }
31 31  
32 32 /* HWMP IE processing macros */
net/wireless/radiotap.c
... ... @@ -59,23 +59,21 @@
59 59 return -EINVAL;
60 60  
61 61 /* sanity check for allowed length and radiotap length field */
62   - if (max_length < le16_to_cpu(get_unaligned(&radiotap_header->it_len)))
  62 + if (max_length < get_unaligned_le16(&radiotap_header->it_len))
63 63 return -EINVAL;
64 64  
65 65 iterator->rtheader = radiotap_header;
66   - iterator->max_length = le16_to_cpu(get_unaligned(
67   - &radiotap_header->it_len));
  66 + iterator->max_length = get_unaligned_le16(&radiotap_header->it_len);
68 67 iterator->arg_index = 0;
69   - iterator->bitmap_shifter = le32_to_cpu(get_unaligned(
70   - &radiotap_header->it_present));
  68 + iterator->bitmap_shifter = get_unaligned_le32(&radiotap_header->it_present);
71 69 iterator->arg = (u8 *)radiotap_header + sizeof(*radiotap_header);
72 70 iterator->this_arg = NULL;
73 71  
74 72 /* find payload start allowing for extended bitmap(s) */
75 73  
76 74 if (unlikely(iterator->bitmap_shifter & (1<<IEEE80211_RADIOTAP_EXT))) {
77   - while (le32_to_cpu(get_unaligned((__le32 *)iterator->arg)) &
78   - (1<<IEEE80211_RADIOTAP_EXT)) {
  75 + while (get_unaligned_le32(iterator->arg) &
  76 + (1 << IEEE80211_RADIOTAP_EXT)) {
79 77 iterator->arg += sizeof(u32);
80 78  
81 79 /*
... ... @@ -241,8 +239,8 @@
241 239 if (iterator->bitmap_shifter & 1) {
242 240 /* b31 was set, there is more */
243 241 /* move to next u32 bitmap */
244   - iterator->bitmap_shifter = le32_to_cpu(
245   - get_unaligned(iterator->next_bitmap));
  242 + iterator->bitmap_shifter =
  243 + get_unaligned_le32(iterator->next_bitmap);
246 244 iterator->next_bitmap++;
247 245 } else
248 246 /* no more bitmaps: end */