]> git.sur5r.net Git - u-boot/blobdiff - common/usb_storage.c
spi: cadence_qspi: Fix warning cast from pointer to integer of different size
[u-boot] / common / usb_storage.c
index a57570b73f3d0a2cafd7f6d4d9093dbc67d18140..9cd64744f8ab9c5c4bf07ab08b4d1702e6cf4094 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Most of this source has been derived from the Linux USB
  * project:
@@ -17,8 +18,6 @@
  *
  * BBB support based on /sys/dev/usb/umass.c from
  * FreeBSD.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 /* Note:
@@ -964,7 +963,7 @@ static void usb_stor_set_max_xfer_blk(struct usb_device *udev,
                blk = 20;
        } else {
                if (size > USHRT_MAX * 512)
-                       blk = USHRT_MAX;
+                       size = USHRT_MAX * 512;
                blk = size / 512;
        }
 #endif