[openwrt/openwrt] kernel: fix warning when building fitblk on 32-bit platforms

LEDE Commits lede-commits at lists.infradead.org
Fri Feb 23 19:44:55 PST 2024


dangole pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/360d27eb76f09f310a47e81c8d2ef07897255fc1

commit 360d27eb76f09f310a47e81c8d2ef07897255fc1
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Sat Feb 24 03:32:13 2024 +0000

    kernel: fix warning when building fitblk on 32-bit platforms
    
    Kernel warns about comparision of different types without cast when
    building the fitblk driver on 32-bit platforms.
    Fix this by using `min_t(size_t, ...`.
    
    Fixes: 8fc5457869 ("kernel: add pending fitblk uImage.FIT sub-image block driver")
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 .../pending-6.1/510-block-add-uImage.FIT-subimage-block-driver.patch | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/target/linux/generic/pending-6.1/510-block-add-uImage.FIT-subimage-block-driver.patch b/target/linux/generic/pending-6.1/510-block-add-uImage.FIT-subimage-block-driver.patch
index 7ee66b318c..54234caf94 100644
--- a/target/linux/generic/pending-6.1/510-block-add-uImage.FIT-subimage-block-driver.patch
+++ b/target/linux/generic/pending-6.1/510-block-add-uImage.FIT-subimage-block-driver.patch
@@ -81,7 +81,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  swim_mod-y	:= swim.o swim_asm.o
 --- /dev/null
 +++ b/drivers/block/fitblk.c
-@@ -0,0 +1,635 @@
+@@ -0,0 +1,636 @@
 +// SPDX-License-Identifier: GPL-2.0-only
 +/*
 + * uImage.FIT virtual block device driver.
@@ -454,7 +454,8 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
 +	bytes_left = size;
 +	fit_c = fit;
 +	while (bytes_left > 0) {
-+		bytes_to_copy = min(bytes_left, folio_size(folio) - offset_in_folio(folio, 0));
++		bytes_to_copy = min_t(size_t, bytes_left,
++				     folio_size(folio) - offset_in_folio(folio, 0));
 +		memcpy(fit_c, pre_fit, bytes_to_copy);
 +		fit_c += bytes_to_copy;
 +		bytes_left -= bytes_to_copy;




More information about the lede-commits mailing list