From patchwork Tue Feb 8 15:50:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Michel Hautbois X-Patchwork-Id: 12738945 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80D1CC433EF for ; Tue, 8 Feb 2022 15:51:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382069AbiBHPvB (ORCPT ); Tue, 8 Feb 2022 10:51:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382213AbiBHPut (ORCPT ); Tue, 8 Feb 2022 10:50:49 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AADF4C061576; Tue, 8 Feb 2022 07:50:48 -0800 (PST) Received: from tatooine.ideasonboard.com (unknown [IPv6:2a01:e0a:169:7140:b99c:2ebe:5dcf:6513]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6D35A1207; Tue, 8 Feb 2022 16:50:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1644335437; bh=4ezLOFyVGbD/VCK56WkHPugF99AY0k6rhe0GdMJ72vU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jCwJdwZkVm6FfKJ0qzwY3q2bohiwJXVYyvbh0BIFmePiaccfCVoqtn3gMITwewzki NK2v1wjdpKJ0ITy5tq384Q9EjoLJRCb6rdAnni3B/6OjyQNaS6+MD5Oo96TFeGz4Bj YIn5AMpovDLVn+OV8k6nM273Neof5X6TzZbjBG60= From: Jean-Michel Hautbois To: jeanmichel.hautbois@ideasonboard.com Cc: dave.stevenson@raspberrypi.com, devicetree@vger.kernel.org, kernel-list@raspberrypi.com, laurent.pinchart@ideasonboard.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, lukasz@jany.st, mchehab@kernel.org, naush@raspberrypi.com, robh@kernel.org, tomi.valkeinen@ideasonboard.com, bcm-kernel-feedback-list@broadcom.com, stefan.wahren@i2se.com Subject: [PATCH v5 07/11] media: imx219: Rename mbus codes array Date: Tue, 8 Feb 2022 16:50:23 +0100 Message-Id: <20220208155027.891055-8-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220208155027.891055-1-jeanmichel.hautbois@ideasonboard.com> References: <20220208155027.891055-1-jeanmichel.hautbois@ideasonboard.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The imx219 is using the name codes[] for the mbus format which is not easy to read and know what it means. Change it to imx219_mbus_formats. Signed-off-by: Jean-Michel Hautbois Reviewed-by: Laurent Pinchart --- drivers/media/i2c/imx219.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c index e10af3f74b38..74dba5e61201 100644 --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c @@ -429,7 +429,7 @@ static const char * const imx219_supply_name[] = { * - v flip * - h&v flips */ -static const u32 codes[] = { +static const u32 imx219_mbus_formats[] = { MEDIA_BUS_FMT_SRGGB10_1X10, MEDIA_BUS_FMT_SGRBG10_1X10, MEDIA_BUS_FMT_SGBRG10_1X10, @@ -655,17 +655,17 @@ static u32 imx219_get_format_code(struct imx219 *imx219, u32 code) lockdep_assert_held(&imx219->mutex); - for (i = 0; i < ARRAY_SIZE(codes); i++) - if (codes[i] == code) + for (i = 0; i < ARRAY_SIZE(imx219_mbus_formats); i++) + if (imx219_mbus_formats[i] == code) break; - if (i >= ARRAY_SIZE(codes)) + if (i >= ARRAY_SIZE(imx219_mbus_formats)) i = 0; i = (i & ~3) | (imx219->vflip->val ? 2 : 0) | (imx219->hflip->val ? 1 : 0); - return codes[i]; + return imx219_mbus_formats[i]; } static void imx219_set_default_format(struct imx219 *imx219) @@ -808,11 +808,11 @@ static int imx219_enum_mbus_code(struct v4l2_subdev *sd, { struct imx219 *imx219 = to_imx219(sd); - if (code->index >= (ARRAY_SIZE(codes) / 4)) + if (code->index >= (ARRAY_SIZE(imx219_mbus_formats) / 4)) return -EINVAL; mutex_lock(&imx219->mutex); - code->code = imx219_get_format_code(imx219, codes[code->index * 4]); + code->code = imx219_get_format_code(imx219, imx219_mbus_formats[code->index * 4]); mutex_unlock(&imx219->mutex); return 0; @@ -908,14 +908,14 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, mutex_lock(&imx219->mutex); - for (i = 0; i < ARRAY_SIZE(codes); i++) - if (codes[i] == fmt->format.code) + for (i = 0; i < ARRAY_SIZE(imx219_mbus_formats); i++) + if (imx219_mbus_formats[i] == fmt->format.code) break; - if (i >= ARRAY_SIZE(codes)) + if (i >= ARRAY_SIZE(imx219_mbus_formats)) i = 0; /* Bayer order varies with flips */ - fmt->format.code = imx219_get_format_code(imx219, codes[i]); + fmt->format.code = imx219_get_format_code(imx219, imx219_mbus_formats[i]); mode = v4l2_find_nearest_size(supported_modes, ARRAY_SIZE(supported_modes),