mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
software: Fix cast from pointer to integer of different size warnings
litex/soc/software/liblitesdcard/sdcard.c: In function 'sdcard_read': litex/soc/software/liblitesdcard/sdcard.c:476:29: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] sdblock2mem_dma_base_write((uint64_t) buf); ^ litex/soc/software/liblitesdcard/sdcard.c: In function 'sdcard_write': litex/soc/software/liblitesdcard/sdcard.c:507:30: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] sdmem2block_dma_base_write((uint64_t) buf); ^ When casting a pointer (32-bit or 64-bit, depending on the platform) to a 64-bit integer, an intermediate cast to "uintptr_t" should be used to avoid warnings like the above. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
This commit is contained in:
parent
5474f563c8
commit
a2389c71ea
2 changed files with 4 additions and 4 deletions
|
@ -51,7 +51,7 @@ void sata_read(uint32_t sector, uint32_t count, uint8_t* buf)
|
|||
for (i=0; i<count; i++) {
|
||||
uint8_t done = 0;
|
||||
while (done == 0) {
|
||||
sata_sector2mem_base_write((uint64_t) buf);
|
||||
sata_sector2mem_base_write((uint64_t)(uintptr_t) buf);
|
||||
sata_sector2mem_sector_write(sector + i);
|
||||
sata_sector2mem_start_write(1);
|
||||
while ((sata_sector2mem_done_read() & 0x1) == 0);
|
||||
|
@ -80,7 +80,7 @@ void sata_write(uint32_t sector, uint32_t count, uint8_t* buf)
|
|||
for (i=0; i<count; i++) {
|
||||
uint8_t done = 0;
|
||||
while (done == 0) {
|
||||
sata_mem2sector_base_write((uint64_t) buf);
|
||||
sata_mem2sector_base_write((uint64_t)(uintptr_t) buf);
|
||||
sata_mem2sector_sector_write(sector + i);
|
||||
sata_mem2sector_start_write(1);
|
||||
while ((sata_sector2mem_done_read() & 0x1) == 0);
|
||||
|
|
|
@ -473,7 +473,7 @@ void sdcard_read(uint32_t block, uint32_t count, uint8_t* buf)
|
|||
{
|
||||
/* Initialize DMA Writer */
|
||||
sdblock2mem_dma_enable_write(0);
|
||||
sdblock2mem_dma_base_write((uint64_t) buf);
|
||||
sdblock2mem_dma_base_write((uint64_t)(uintptr_t) buf);
|
||||
sdblock2mem_dma_length_write(512*count);
|
||||
sdblock2mem_dma_enable_write(1);
|
||||
|
||||
|
@ -504,7 +504,7 @@ void sdcard_write(uint32_t block, uint32_t count, uint8_t* buf)
|
|||
while (count--) {
|
||||
/* Initialize DMA Reader */
|
||||
sdmem2block_dma_enable_write(0);
|
||||
sdmem2block_dma_base_write((uint64_t) buf);
|
||||
sdmem2block_dma_base_write((uint64_t)(uintptr_t) buf);
|
||||
sdmem2block_dma_length_write(512);
|
||||
sdmem2block_dma_enable_write(1);
|
||||
|
||||
|
|
Loading…
Reference in a new issue