]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
spi: bcm63xx-hsspi: Fix compiler warning
authorWilliam Zhang <william.zhang@broadcom.com>
Sat, 12 Aug 2023 02:03:19 +0000 (19:03 -0700)
committerJagan Teki <jagan@edgeble.ai>
Wed, 6 Dec 2023 12:30:50 +0000 (18:00 +0530)
When build for arm64 target, comipler reports the following warning:
drivers/spi/bcm63xx_hsspi.c: In function ‘bcm63xx_hsspi_xfer_dummy_cs’:
include/linux/kernel.h:184:17: warning: comparison of distinct pointer
types lacks a cast
  184 |  (void) (&_min1 == &_min2);  \
      |                 ^~
drivers/spi/bcm63xx_hsspi.c:298:22: note: in expansion of macro ‘min’
  298 |   size_t curr_step = min(step_size, data_bytes);

This change fix this warning by casting the data_bytes to size_t.

Fixes: 0e144ec38cbb ("spi: bcm63xx-hsspi: Add prepend mode support")
Signed-off-by: William Zhang <william.zhang@broadcom.com>
drivers/spi/bcm63xx_hsspi.c

index a24bb430cbb4eef6d672e53d3e4fc4bf09292c22..19d9a5ae23cde62a0ac0d3784dc32bf115b4864d 100644 (file)
@@ -295,7 +295,7 @@ static int bcm63xx_hsspi_xfer_dummy_cs(struct udevice *dev, unsigned int data_by
 
        /* transfer loop */
        while (data_bytes > 0) {
-               size_t curr_step = min(step_size, data_bytes);
+               size_t curr_step = min(step_size, (size_t)data_bytes);
                int ret;
 
                /* copy tx data */