Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

wireless: use get/put_unaligned_* helpers

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

authored by

Harvey Harrison and committed by
John W. Linville
ae7245cb 5a433b3a

+8 -10
+1 -1
net/mac80211/mesh_hwmp.c
··· 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 */
+7 -9
net/wireless/radiotap.c
··· 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 /* ··· 239 241 if (iterator->bitmap_shifter & 1) { 240 242 /* b31 was set, there is more */ 241 243 /* move to next u32 bitmap */ 242 - iterator->bitmap_shifter = le32_to_cpu( 243 - get_unaligned(iterator->next_bitmap)); 244 + iterator->bitmap_shifter = 245 + get_unaligned_le32(iterator->next_bitmap); 244 246 iterator->next_bitmap++; 245 247 } else 246 248 /* no more bitmaps: end */