Skip to contentSkip to conversation

erofs-utils: fix `z_erofs_fixup_insize` defined but not used

PATCH In review Gao Xiang 2 participants 3 messages May 7, 2025 Library code

lore
Share & tools
lore

Gao Xiang

author
#0 lore raw

PATCH 1/1 erofs-utils: fix `z_erofs_fixup_insize` defined but not used

Fixes b08e804b1dd1 ("erofs-utils: lib: wrap up zeropadding calculation")
---
 lib/decompress.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/decompress.c +2 -2
index 3f553a8..1f9daea 100644
@@ -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
#1 lore raw
Quoted 11 lines · Gao Xiang
Fixes b08e804b1dd1 ("erofs-utils: lib: wrap up zeropadding calculation")
---
  lib/decompress.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
lib/decompress.c +0 -0
index 3f553a8..1f9daea 100644

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);
author
#2 lore raw
Quoted 9 lines · Hongbo Li
Quoted 6 lines · Gao Xiang
Fixes b08e804b1dd1 ("erofs-utils: lib: wrap up zeropadding calculation")

---
  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
index 3f553a8..1f9daea 100644
@@ -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,
Hongbo

Quoted 4 lines
lib/decompress.c +1 -1
-    unsigned int inputmargin;
+    u32 inputmargin;

      for (inputmargin = 0; inputmargin < padbufsize && !padbuf[inputmargin]; ++inputmargin);