[PATCH 07/10] drm/tinydrm: Move tinydrm_machine_little_endian()

David Lechner david at lechnology.com
Wed Jul 17 20:09:18 UTC 2019


On 7/17/19 6:58 AM, Noralf Trønnes wrote:
> The tinydrm helper is going away so move it into the only user mipi-dbi.
> 
> Signed-off-by: Noralf Trønnes <noralf at tronnes.org>
> ---
>   drivers/gpu/drm/tinydrm/mipi-dbi.c    | 15 ++++++++++++---
>   include/drm/tinydrm/tinydrm-helpers.h | 15 ---------------
>   2 files changed, 12 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c b/drivers/gpu/drm/tinydrm/mipi-dbi.c
> index 6a8f2d66377f..73db287e5c52 100644
> --- a/drivers/gpu/drm/tinydrm/mipi-dbi.c
> +++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c
> @@ -628,6 +628,15 @@ u32 mipi_dbi_spi_cmd_max_speed(struct spi_device *spi, size_t len)
>   }
>   EXPORT_SYMBOL(mipi_dbi_spi_cmd_max_speed);
>   
> +static bool mipi_dbi_machine_little_endian(void)
> +{
> +#if defined(__LITTLE_ENDIAN)
> +	return true;
> +#else
> +	return false;
> +#endif
> +}
> +

I'm kind of surprised that there isn't something like this elsewhere
in the kernel already. The way this function is being used it kind of
seems like it should be static __always_inline (or a macro) so that
the compiler can do a better job optimizing the code (although it is
a very minor improvement).


More information about the dri-devel mailing list