iwlwifi: use upper_32_bits/lower_32_bits where appropriate
authorJohannes Berg <johannes.berg@intel.com>
Mon, 9 Jan 2017 10:28:47 +0000 (11:28 +0100)
committerLuca Coelho <luciano.coelho@intel.com>
Tue, 11 Apr 2017 11:54:34 +0000 (14:54 +0300)
That's a bit nicer than open-coding it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/iwl-fh.h
drivers/net/wireless/intel/iwlwifi/iwl-io.c

index 33ef5372d1951b2b58618a5acb9c4b89657252eb..361fc25e8618c0b748b42f1fd4f8245ddf84f8c3 100644 (file)
@@ -647,7 +647,7 @@ struct iwl_rb_status {
 
 static inline u8 iwl_get_dma_hi_addr(dma_addr_t addr)
 {
-       return (sizeof(addr) > sizeof(u32) ? (addr >> 16) >> 16 : 0) & 0xF;
+       return (sizeof(addr) > sizeof(u32) ? upper_32_bits(addr) : 0) & 0xF;
 }
 /**
  * struct iwl_tfd_tb transmit buffer descriptor within transmit frame descriptor
index a9f69fdd170b0fd0fb039ffb949a657c7dcefefd..0f893ae6e715b52c96a1886cca445a3612afd434 100644 (file)
@@ -54,8 +54,8 @@ IWL_EXPORT_SYMBOL(iwl_write32);
 void iwl_write64(struct iwl_trans *trans, u64 ofs, u64 val)
 {
        trace_iwlwifi_dev_iowrite64(trans->dev, ofs, val);
-       iwl_trans_write32(trans, ofs, val & 0xffffffff);
-       iwl_trans_write32(trans, ofs + 4, val >> 32);
+       iwl_trans_write32(trans, ofs, lower_32_bits(val));
+       iwl_trans_write32(trans, ofs + 4, upper_32_bits(val));
 }
 IWL_EXPORT_SYMBOL(iwl_write64);