Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8013FC7EE23 for ; Thu, 1 Jun 2023 16:28:34 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4DB918638D; Thu, 1 Jun 2023 18:25:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="gIHpMEuG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 74D6886373; Thu, 1 Jun 2023 18:24:52 +0200 (CEST) Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 998DE86347 for ; Thu, 1 Jun 2023 18:24:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x131.google.com with SMTP id e9e14a558f8ab-33b1e83e1daso3969675ab.0 for ; Thu, 01 Jun 2023 09:24:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1685636687; x=1688228687; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=N+XtIYeg9r7FNkDuKrwk9/IJV00v+x6TNpOF1rQlOCY=; b=gIHpMEuGflT7njoWeEEuA3qjWHzM+AOirPpcRB/kRiLCHrxPZYmzt1/mwl5SHgDMFY manNC9xgZRp6n/PzlP4HwK7ZsGUFtbDNsI1KdxLo2D5++fwqXr6uP7Rj1wAF6LpZGVYp SQLAwACJW/AXkt15ILfKoeGGCaglnVWeqWUlM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685636687; x=1688228687; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N+XtIYeg9r7FNkDuKrwk9/IJV00v+x6TNpOF1rQlOCY=; b=am+9alZuc03G+ciELP0Kx3spYuj4QX7ycW31sC6gCfikX4EXSdei9bBp49PVAEp2SK jWtn+CTF5GgHLKYEx/UqNHb86ZQlAg/dSa5GbhYtJolkPxhSDvkuzb5y0oGqfsm0XJPj OiRuGr2VHDJlosZC8o3poI+4WmQCiFIEWScyXgg+sO3PQOaCnOnwrP+8zRUh74W8bVww QDwcWKjoqucsobtFOjSSK7CION8rKZ2mLY08khlqGYyrg0NnPa96WEvCdYGJh9axhJsg GHVlCJeJ3tVUmiz+29q70U8qBpv7jfsnwkVCBDo/lQdcVOmHjlQ1JIkpNYFxK3XRAcXW f7Qg== X-Gm-Message-State: AC+VfDzV5wny+Rxi79tPkOjpfEMcuYJSB9b8luKb3uFAQglxuNbvS7Cf ThL2IWtL1LfIgo9lSwk04O1tFubKq/zTzfYeL/A= X-Google-Smtp-Source: ACHHUZ6JhQgw3XKa1rex4rDER32Nt2bYunvHIQ0XLlV1sCar6ufnyJljXUSaP0QTlaMzFjHJwFQZ6Q== X-Received: by 2002:a92:d986:0:b0:328:52d1:6415 with SMTP id r6-20020a92d986000000b0032852d16415mr6538152iln.15.1685636687075; Thu, 01 Jun 2023 09:24:47 -0700 (PDT) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id l1-20020a922901000000b0033a6e7ee4e3sm3862098ilg.1.2023.06.01.09.24.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 09:24:46 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Tom Rini , Simon Glass , Anatolij Gustschin Subject: [PATCH 24/40] video: Use enum with video_index_to_colour() Date: Thu, 1 Jun 2023 10:22:48 -0600 Message-ID: <20230601162404.220488-23-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.rc0.172.g3f132b7071-goog In-Reply-To: <20230601162404.220488-1-sjg@chromium.org> References: <20230601162404.220488-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Use the provided enum with this function, so it is clearer what should be passed to it. Signed-off-by: Simon Glass --- drivers/video/video-uclass.c | 2 +- include/video.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index 1db049bec004..5bf40e1138f4 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -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: diff --git a/include/video.h b/include/video.h index dd0d55baa31a..124eb49fab7d 100644 --- a/include/video.h +++ b/include/video.h @@ -163,10 +163,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 -- 2.41.0.rc0.172.g3f132b7071-goog