aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mtd/devices/st_spi_fsm.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c
index 7cc49ba78f68..f97fe144077d 100644
--- a/drivers/mtd/devices/st_spi_fsm.c
+++ b/drivers/mtd/devices/st_spi_fsm.c
@@ -755,7 +755,7 @@ static void stfsm_read_fifo(struct stfsm *fsm, uint32_t *buf, uint32_t size)
755 755
756 dev_dbg(fsm->dev, "Reading %d bytes from FIFO\n", size); 756 dev_dbg(fsm->dev, "Reading %d bytes from FIFO\n", size);
757 757
758 BUG_ON((((uint32_t)buf) & 0x3) || (size & 0x3)); 758 BUG_ON((((uintptr_t)buf) & 0x3) || (size & 0x3));
759 759
760 while (remaining) { 760 while (remaining) {
761 for (;;) { 761 for (;;) {
@@ -779,7 +779,7 @@ static int stfsm_write_fifo(struct stfsm *fsm, const uint32_t *buf,
779 779
780 dev_dbg(fsm->dev, "writing %d bytes to FIFO\n", size); 780 dev_dbg(fsm->dev, "writing %d bytes to FIFO\n", size);
781 781
782 BUG_ON((((uint32_t)buf) & 0x3) || (size & 0x3)); 782 BUG_ON((((uintptr_t)buf) & 0x3) || (size & 0x3));
783 783
784 writesl(fsm->base + SPI_FAST_SEQ_DATA_REG, buf, words); 784 writesl(fsm->base + SPI_FAST_SEQ_DATA_REG, buf, words);
785 785
@@ -1474,7 +1474,7 @@ static int stfsm_read(struct stfsm *fsm, uint8_t *buf, uint32_t size,
1474 read_mask = (data_pads << 2) - 1; 1474 read_mask = (data_pads << 2) - 1;
1475 1475
1476 /* Handle non-aligned buf */ 1476 /* Handle non-aligned buf */
1477 p = ((uint32_t)buf & 0x3) ? (uint8_t *)page_buf : buf; 1477 p = ((uintptr_t)buf & 0x3) ? (uint8_t *)page_buf : buf;
1478 1478
1479 /* Handle non-aligned size */ 1479 /* Handle non-aligned size */
1480 size_ub = (size + read_mask) & ~read_mask; 1480 size_ub = (size + read_mask) & ~read_mask;
@@ -1496,7 +1496,7 @@ static int stfsm_read(struct stfsm *fsm, uint8_t *buf, uint32_t size,
1496 } 1496 }
1497 1497
1498 /* Handle non-aligned buf */ 1498 /* Handle non-aligned buf */
1499 if ((uint32_t)buf & 0x3) 1499 if ((uintptr_t)buf & 0x3)
1500 memcpy(buf, page_buf, size); 1500 memcpy(buf, page_buf, size);
1501 1501
1502 /* Wait for sequence to finish */ 1502 /* Wait for sequence to finish */
@@ -1538,7 +1538,7 @@ static int stfsm_write(struct stfsm *fsm, const uint8_t *buf,
1538 write_mask = (data_pads << 2) - 1; 1538 write_mask = (data_pads << 2) - 1;
1539 1539
1540 /* Handle non-aligned buf */ 1540 /* Handle non-aligned buf */
1541 if ((uint32_t)buf & 0x3) { 1541 if ((uintptr_t)buf & 0x3) {
1542 memcpy(page_buf, buf, size); 1542 memcpy(page_buf, buf, size);
1543 p = (uint8_t *)page_buf; 1543 p = (uint8_t *)page_buf;
1544 } else { 1544 } else {
@@ -1701,7 +1701,7 @@ static int stfsm_mtd_write(struct mtd_info *mtd, loff_t to, size_t len,
1701 1701
1702 while (len) { 1702 while (len) {
1703 /* Write up to page boundary */ 1703 /* Write up to page boundary */
1704 bytes = min(FLASH_PAGESIZE - page_offs, len); 1704 bytes = min_t(size_t, FLASH_PAGESIZE - page_offs, len);
1705 1705
1706 ret = stfsm_write(fsm, b, bytes, to); 1706 ret = stfsm_write(fsm, b, bytes, to);
1707 if (ret) 1707 if (ret)