diff mbox series

lib/tst_kvercmp.c: Update tst_parse_kver() condition

Message ID 20211028085620.2499-1-egor.petrov@oracle.com
State Accepted
Headers show
Series lib/tst_kvercmp.c: Update tst_parse_kver() condition | expand

Commit Message

Egor Petrov Oct. 28, 2021, 8:56 a.m. UTC
tst_parse_kver() fails with kernel names like current
mainline kernel "5.15-rc7". Updated condition to fit
this template.

Signed-off-by: Egor Petrov <egor.petrov@oracle.com>
---
 lib/tst_kvercmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Petr Vorel Oct. 29, 2021, 7:50 a.m. UTC | #1
Hi Egor,

> tst_parse_kver() fails with kernel names like current
> mainline kernel "5.15-rc7". Updated condition to fit
> this template.
Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr
Cyril Hrubis Oct. 29, 2021, 11:45 a.m. UTC | #2
Hi!
Pushed, thanks.
diff mbox series

Patch

diff --git a/lib/tst_kvercmp.c b/lib/tst_kvercmp.c
index 8bf65d309..dc0daa746 100644
--- a/lib/tst_kvercmp.c
+++ b/lib/tst_kvercmp.c
@@ -65,7 +65,7 @@  int tst_parse_kver(const char *str_kver, int *v1, int *v2, int *v3)
 	/*
 	 * Check for a short version e.g '2.4'
 	 */
-	if (*str == ' ' || *str == '\0')
+	if (*str == ' ' || *str == '\0' || *str == '-')
 		return 0;
 
 	if (*(str++) != '.')