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

i3c: mipi-i3c-hci: Switch to lower_32_bits()/upper_32_bits() helpers

Rather than having own lo32()/hi32() helpers for dealing with 32-bit and
64-bit build targets switch to generic lower_32_bits()/upper_32_bits()
helpers.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Link: https://lore.kernel.org/r/20240628131559.502822-1-jarkko.nikula@linux.intel.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

authored by

Jarkko Nikula and committed by
Alexandre Belloni
74e931f0 d9deb28f

+6 -21
+6 -21
drivers/i3c/master/mipi-i3c-hci/dma.c
··· 147 147 unsigned int max_len; 148 148 }; 149 149 150 - static inline u32 lo32(dma_addr_t physaddr) 151 - { 152 - return physaddr; 153 - } 154 - 155 - static inline u32 hi32(dma_addr_t physaddr) 156 - { 157 - /* trickery to avoid compiler warnings on 32-bit build targets */ 158 - if (sizeof(dma_addr_t) > 4) { 159 - u64 hi = physaddr; 160 - return hi >> 32; 161 - } 162 - return 0; 163 - } 164 - 165 150 static void hci_dma_cleanup(struct i3c_hci *hci) 166 151 { 167 152 struct hci_rings_data *rings = hci->io_data; ··· 250 265 if (!rh->xfer || !rh->resp || !rh->src_xfers) 251 266 goto err_out; 252 267 253 - rh_reg_write(CMD_RING_BASE_LO, lo32(rh->xfer_dma)); 254 - rh_reg_write(CMD_RING_BASE_HI, hi32(rh->xfer_dma)); 255 - rh_reg_write(RESP_RING_BASE_LO, lo32(rh->resp_dma)); 256 - rh_reg_write(RESP_RING_BASE_HI, hi32(rh->resp_dma)); 268 + rh_reg_write(CMD_RING_BASE_LO, lower_32_bits(rh->xfer_dma)); 269 + rh_reg_write(CMD_RING_BASE_HI, upper_32_bits(rh->xfer_dma)); 270 + rh_reg_write(RESP_RING_BASE_LO, lower_32_bits(rh->resp_dma)); 271 + rh_reg_write(RESP_RING_BASE_HI, upper_32_bits(rh->resp_dma)); 257 272 258 273 regval = FIELD_PREP(CR_RING_SIZE, rh->xfer_entries); 259 274 rh_reg_write(CR_SETUP, regval); ··· 389 404 hci_dma_unmap_xfer(hci, xfer_list, i); 390 405 return -ENOMEM; 391 406 } 392 - *ring_data++ = lo32(xfer->data_dma); 393 - *ring_data++ = hi32(xfer->data_dma); 407 + *ring_data++ = lower_32_bits(xfer->data_dma); 408 + *ring_data++ = upper_32_bits(xfer->data_dma); 394 409 } else { 395 410 *ring_data++ = 0; 396 411 *ring_data++ = 0;