[U-Boot] [PATCH] dm: video: fix abuse of enum

Simon Glass sjg at chromium.org
Tue Jun 20 18:26:29 UTC 2017


Hi Lothar,

On 20 June 2017 at 04:25, Lothar Waßmann <LW at karo-electronics.de> wrote:
> LCD_MAX_WIDTH, LCD_MAX_HEIGHT and LCD_MAX_LSBPP are not alternative
> values for one specific variable, but unrelated entities with distinct
> purposes. There is no use defining them as values of an 'enum'.

Can you explain why #define is better? I prefer enum since they are a
compiler construct instead of preprocessor (thus no need for brackets,
no strange conversion things) and the debugger knows about them.

>
> The 'enum' construct would fail miserably for an LCD controller that
> has a square max. frame size (e.g. 4096x4096).

What does this mean? I don't understand sorry.

>
> Signed-off-by: Lothar Waßmann <LW at KARO-electronics.de>
> ---
>  drivers/video/atmel_hlcdfb.c     |  8 +++-----
>  drivers/video/atmel_lcdfb.c      | 10 ++++------
>  drivers/video/sandbox_sdl.c      |  8 +++-----
>  drivers/video/tegra.c            | 12 +++++-------
>  drivers/video/tegra124/display.c | 11 +++++------
>  5 files changed, 20 insertions(+), 29 deletions(-)
>

Regards,
Simon


More information about the U-Boot mailing list