Commit 28d21887 authored by Tao Su's avatar Tao Su Committed by Andrew Morton

selftests/harness: use 1024 in place of LINE_MAX

Android was seeing a compilation error because its C library does not
define LINE_MAX.  Since LINE_MAX is only used to determine the size of
test_name[] and 1024 should be enough for the test name, use 1024 instead
of LINE_MAX.

Link: https://lkml.kernel.org/r/20240509053113.43462-3-tao1.su@linux.intel.com
Fixes: 38c957f0 ("selftests: kselftest_harness: generate test name once")
Signed-off-by: default avatarTao Su <tao1.su@linux.intel.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Bongsu Jeon <bongsu.jeon@samsung.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Edward Liaw <edliaw@google.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Ivan Orlov <ivan.orlov0322@gmail.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Jarkko Sakkinen <jarkko@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Mark Brown <broonie@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Takashi Iwai <tiwai@suse.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 6bb955fc
...@@ -56,7 +56,6 @@ static_assert(0, "kselftest harness requires _GNU_SOURCE to be defined"); ...@@ -56,7 +56,6 @@ static_assert(0, "kselftest harness requires _GNU_SOURCE to be defined");
#include <asm/types.h> #include <asm/types.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>
#include <limits.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
...@@ -1217,7 +1216,7 @@ void __run_test(struct __fixture_metadata *f, ...@@ -1217,7 +1216,7 @@ void __run_test(struct __fixture_metadata *f,
struct __test_metadata *t) struct __test_metadata *t)
{ {
struct __test_xfail *xfail; struct __test_xfail *xfail;
char test_name[LINE_MAX]; char test_name[1024];
const char *diagnostic; const char *diagnostic;
/* reset test struct */ /* reset test struct */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment