Skip to content

Commit bd31dd9

Browse files
jmberg-intellucacoelho
authored andcommitted
iwlwifi: use upper_32_bits/lower_32_bits where appropriate
That's a bit nicer than open-coding it. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
1 parent 1c17627 commit bd31dd9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

drivers/net/wireless/intel/iwlwifi/iwl-fh.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ struct iwl_rb_status {
647647

648648
static inline u8 iwl_get_dma_hi_addr(dma_addr_t addr)
649649
{
650-
return (sizeof(addr) > sizeof(u32) ? (addr >> 16) >> 16 : 0) & 0xF;
650+
return (sizeof(addr) > sizeof(u32) ? upper_32_bits(addr) : 0) & 0xF;
651651
}
652652
/**
653653
* struct iwl_tfd_tb transmit buffer descriptor within transmit frame descriptor

drivers/net/wireless/intel/iwlwifi/iwl-io.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ IWL_EXPORT_SYMBOL(iwl_write32);
5454
void iwl_write64(struct iwl_trans *trans, u64 ofs, u64 val)
5555
{
5656
trace_iwlwifi_dev_iowrite64(trans->dev, ofs, val);
57-
iwl_trans_write32(trans, ofs, val & 0xffffffff);
58-
iwl_trans_write32(trans, ofs + 4, val >> 32);
57+
iwl_trans_write32(trans, ofs, lower_32_bits(val));
58+
iwl_trans_write32(trans, ofs + 4, upper_32_bits(val));
5959
}
6060
IWL_EXPORT_SYMBOL(iwl_write64);
6161

0 commit comments

Comments
 (0)