Skip to contentSkip to conversation

lib: dhry: miscellaneous cleanups

PATCH New Geert Uytterhoeven 1 participant 4 messages Jan 22, 2024 Library code

lore
Share & tools
lore
#0 lore raw

cover lib: dhry: miscellaneous cleanups

Hi Andrew,

This patch series contains a few miscellaneous cleanups for the Dhrystone benchmark test.

Thanks!

Geert Uytterhoeven (3):
lib: dhry: remove unneeded <linux/mutex.h>
lib: dhry: use ktime_ms_delta() helper
lib: dhry: add missing closing parenthesis

 lib/Kconfig.debug | 2 +-
 lib/dhry_1.c      | 2 +-
 lib/dhry_run.c    | 1 -
 3 files changed, 2 insertions(+), 3 deletions(-)
Signature · 12 lines
2.34.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds
#1 lore raw

PATCH 1/3 lib: dhry: remove unneeded <linux/mutex.h>

The Dhrystone benchmark test does not use mutexes.

---
 lib/dhry_run.c | 1 -
 1 file changed, 1 deletion(-)
lib/dhry_run.c +0 -1
index f15ac666e9d38bd2..e6a279dabf848eb3 100644
@@ -10,7 +10,6 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
-#include <linux/mutex.h>
 #include <linux/smp.h>
 
 #define DHRY_VAX	1757
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/3 lib: dhry: use ktime_ms_delta() helper

In reply to Geert Uytterhoeven

Use the existing ktime_ms_delta() helper instead of open-coding the same operation.

---
 lib/dhry_1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/dhry_1.c +1 -1
index 08edbbb19f573ff7..ca6c87232c580954 100644
@@ -277,7 +277,7 @@ int dhry(int n)
 	dhry_assert_string_eq(Str_1_Loc, "DHRYSTONE PROGRAM, 1'ST STRING");
 	dhry_assert_string_eq(Str_2_Loc, "DHRYSTONE PROGRAM, 2'ND STRING");
 
-	User_Time = ktime_to_ms(ktime_sub(End_Time, Begin_Time));
+	User_Time = ktime_ms_delta(End_Time, Begin_Time);
 
 	kfree(Ptr_Glob);
 	kfree(Next_Ptr_Glob);
Signature · 1 line
2.34.1
#3 lore raw

PATCH 3/3 lib: dhry: add missing closing parenthesis

In reply to Geert Uytterhoeven

The help text for the Dhrystone benchmark test lacks a matching closing parenthesis.

---
 lib/Kconfig.debug | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/Kconfig.debug +1 -1
index 79dc58b938f860d3..b93eccc2ebfb756a 100644
@@ -2141,7 +2141,7 @@ config TEST_DHRY
 
 	  To run the benchmark, it needs to be enabled explicitly, either from
 	  the kernel command line (when built-in), or from userspace (when
-	  built-in or modular.
+	  built-in or modular).
 
 	  Run once during kernel boot:
 
Signature · 1 line
2.34.1