]> git.baikalelectronics.ru Git - uboot.git/commit
mmc: tmio: Check 'addr' width before checking for 64bit limitation
authorMarek Vasut <marek.vasut+renesas@mailbox.org>
Tue, 28 Feb 2023 21:18:12 +0000 (22:18 +0100)
committerMarek Vasut <marek.vasut+renesas@mailbox.org>
Fri, 7 Apr 2023 15:13:27 +0000 (17:13 +0200)
commit3cc073e071057b01e5c0be0e47c8de8597c1dc7f
treee35cb39d229381cf2f8fee7db0d1e2de020c84cd
parentcbb51f335c6ae0e7e148d8df43da252885651613
mmc: tmio: Check 'addr' width before checking for 64bit limitation

The 64bit limitation check is compiled and optimized out on 32bit
platforms, but generates a type width warning:

drivers/mmc/tmio-common.c: In function ‘tmio_sd_addr_is_dmaable’:
drivers/mmc/tmio-common.c:376:26: warning: right shift count >= width of type [-Wshift-count-overflow]
  376 |                 if (addr >> 32)
      |                          ^~

Fix the warning by checking the addr type width to see whether the
shift even makes sense in the first place. The width check is also
optimized out at compile time.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
drivers/mmc/tmio-common.c