lkml.org 
[lkml]   [2018]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] lib/test_hexdump: fix failure on big endian cpu
Date
Christophe Leroy <christophe.leroy@c-s.fr> writes:
> diff --git a/lib/test_hexdump.c b/lib/test_hexdump.c
> index 3f415d8101f3..626f580b4ff7 100644
> --- a/lib/test_hexdump.c
> +++ b/lib/test_hexdump.c
> @@ -32,16 +32,33 @@ static const char * const test_data_2_le[] __initconst = {
> "d14c", "9919", "b143", "0caf",
> };
>
> +static const char * const test_data_2_be[] __initconst = {
> + "be32", "db7b", "0a18", "93b2",
> + "70ba", "c424", "7d83", "349b",
> + "a69c", "31ad", "9c0f", "ace9",
> + "4cd1", "1999", "43b1", "af0c",
> +};
> +
> static const char * const test_data_4_le[] __initconst = {
> "7bdb32be", "b293180a", "24c4ba70", "9b34837d",
> "ad319ca6", "e9ac0f9c", "9919d14c", "0cafb143",
> };
>
> +static const char * const test_data_4_be[] __initconst = {
> + "be32db7b", "0a1893b2", "70bac424", "7d83349b",
> + "a69c31ad", "9c0face9", "4cd11999", "43b1af0c",
> +};
> +

Is there a reason we can't do it all at compile time?

eg:

static const char * const test_data_4[] __initconst = {
#ifdef CONFIG_CPU_LITTLE_ENDIAN
"7bdb32be", "b293180a", "24c4ba70", "9b34837d",
"ad319ca6", "e9ac0f9c", "9919d14c", "0cafb143",
#else
"be32db7b", "0a1893b2", "70bac424", "7d83349b",
"a69c31ad", "9c0face9", "4cd11999", "43b1af0c",
#endif
};


cheers

\
 
 \ /
  Last update: 2018-08-08 09:26    [W:0.069 / U:0.048 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site