erofs-utils: fix `z_erofs_fixup_insize` defined but not used
PATCH 1/1 erofs-utils: fix `z_erofs_fixup_insize` defined but not used
Fixes b08e804b1dd1 ("erofs-utils: lib: wrap up zeropadding calculation")
Signed-off-by Gao Xiang <[email protected]>
--- lib/decompress.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/decompress.c +2 -2
@@ -9,9 +9,9 @@#include "erofs/err.h" #include "erofs/print.h" -static unsigned int z_erofs_fixup_insize (const u8 *padbuf,unsigned int padbufsize) +static inline u32 z_erofs_fixup_insize (const u8 *padbuf,u32 padbufsize) { -unsigned int inputmargin; +u32 inputmargin;for (inputmargin =0 ; inputmargin < padbufsize && !padbuf[inputmargin]; ++inputmargin);
Signature · 1 line
2.43.5
Quoted 11 lines · Gao Xiang
Fixes b08e804b1dd1 ("erofs-utils: lib: wrap up zeropadding calculation")Signed-off-by Gao Xiang <[email protected]>--- lib/decompress.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)lib/decompress.c +0
-0
lib/decompress.c line 13
Quoted 6 lines
lib/decompress.c +1
-1@@ -9,9 +9,9 @@#include "erofs/err.h" #include "erofs/print.h" -static unsigned int z_erofs_fixup_insize (const u8 *padbuf,unsigned int padbufsize) +static inline u32 z_erofs_fixup_insize (const u8 *padbuf,u32 padbufsize) {
How about using macro to constrain it? Like I send in [1].
[1] https://lore.kernel.org/all/[email protected]/
Thanks,
Hongbo
Quoted 5 lines
lib/decompress.c +1
-1-unsigned int inputmargin; +u32 inputmargin;for (inputmargin =0 ; inputmargin < padbufsize && !padbuf[inputmargin]; ++inputmargin);
Quoted 9 lines · Hongbo Li
Quoted 6 lines · Gao Xiang
Fixes b08e804b1dd1 ("erofs-utils: lib: wrap up zeropadding calculation")Signed-off-by Gao Xiang <[email protected]>---
lib/decompress.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 11 lines
lib/decompress.c line 12
Quoted 10 lines
lib/decompress.c +1
-1@@ -9,9 +9,9 @@ #include "erofs/err.h" #include "erofs/print.h" -static unsigned int z_erofs_fixup_insize (const u8 *padbuf,unsigned int padbufsize) +static inline u32 z_erofs_fixup_insize (const u8 *padbuf,u32 padbufsize) {How about using macro to constrain it? Like I send in [1].
There are too many macros related to this, you could check..
Quoted 10 lines
[1] https://lore.kernel.org/all/[email protected]/
Thanks,
HongboQuoted 4 lines
lib/decompress.c +1
-1- unsigned int inputmargin; + u32 inputmargin;for (inputmargin = 0; inputmargin < padbufsize && !padbuf[inputmargin]; ++inputmargin);