]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
video: Use enum with video_index_to_colour()
authorSimon Glass <sjg@chromium.org>
Thu, 1 Jun 2023 16:22:48 +0000 (10:22 -0600)
committerTom Rini <trini@konsulko.com>
Fri, 14 Jul 2023 16:54:51 +0000 (12:54 -0400)
Use the provided enum with this function, so it is clearer what should be
passed to it.

Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/video/video-uclass.c
include/video.h

index d304e92c2441e0ecc2d7d25bd3d3e01971318797..95e874b770b28c446cf81c37250a7f29153c2125 100644 (file)
@@ -260,7 +260,7 @@ static const struct vid_rgb colours[VID_COLOUR_COUNT] = {
        { 0xff, 0xff, 0xff },  /* white */
 };
 
-u32 video_index_to_colour(struct video_priv *priv, unsigned int idx)
+u32 video_index_to_colour(struct video_priv *priv, enum colour_idx idx)
 {
        switch (priv->bpix) {
        case VIDEO_BPP16:
index 55e9f32f5935b76053e8e36aeeb9a76c9283db96..e98d0f9c895db8e381b9f3559d34441f3e57bece 100644 (file)
@@ -164,10 +164,10 @@ enum colour_idx {
  * VID_COLOR_COUNT.
  *
  * @priv       private data of the video device (UCLASS_VIDEO)
- * @idx                color index
+ * @idx                color index (e.g. VID_YELLOW)
  * Return:     color value
  */
-u32 video_index_to_colour(struct video_priv *priv, unsigned int idx);
+u32 video_index_to_colour(struct video_priv *priv, enum colour_idx idx);
 
 /**
  * video_reserve() - Reserve frame-buffer memory for video devices