[PATCH 7/8] show_progress: change HASHES_PER_LINE from 65 to 64 to avoid division

Ahmad Fatoum a.fatoum at pengutronix.de
Tue Feb 16 15:02:07 EST 2021


Decreasing the progress bar length by one won't change visuals much,
but will allow the compiler to optimize a multiplication and a modulo
into bitwise operations.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 lib/show_progress.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/show_progress.c b/lib/show_progress.c
index 259fb7ab190c..d0d7b31303dc 100644
--- a/lib/show_progress.c
+++ b/lib/show_progress.c
@@ -19,7 +19,7 @@
 #include <progress.h>
 #include <linux/math64.h>
 
-#define HASHES_PER_LINE	65
+#define HASHES_PER_LINE	64
 
 static int printed;
 static int progress_max;
-- 
2.29.2




More information about the barebox mailing list