Re: [PATCH 1/3] Be more verbose on endianness detection failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Feb 11 2017, kusumi.tomohiro@xxxxxxxxx wrote:
> From: Tomohiro Kusumi <tkusumi@xxxxxxxxxx>
> 
> Signed-off-by: Tomohiro Kusumi <tkusumi@xxxxxxxxxx>
> ---
>  libfio.c | 29 ++++++++++++++++++++++++-----
>  1 file changed, 24 insertions(+), 5 deletions(-)
> 
> diff --git a/libfio.c b/libfio.c
> index 960daf6..096efe2 100644
> --- a/libfio.c
> +++ b/libfio.c
> @@ -327,16 +327,16 @@ static int endian_check(void)
>  
>  #if defined(CONFIG_LITTLE_ENDIAN)
>  	if (be)
> -		return 1;
> +		return 1; /* should be little */
>  #elif defined(CONFIG_BIG_ENDIAN)
>  	if (le)
> -		return 1;
> +		return 2; /* should be big */

I think this deserves and enum. That also enables the compiler to check
if the below switch covers all the potential values.

-- 
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux