Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1761669rwb; Thu, 17 Nov 2022 01:22:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf5yMhNeBd8ef/oqDGuVMLBsfpRo+LhG/A8kflYlN/P5T8eB2BWFb/ngXpzRMO/8eFPeyStF X-Received: by 2002:a17:90b:1282:b0:214:1804:d96b with SMTP id fw2-20020a17090b128200b002141804d96bmr1903630pjb.90.1668676956156; Thu, 17 Nov 2022 01:22:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668676956; cv=none; d=google.com; s=arc-20160816; b=MTR/0vXWqSy4NJxjtZbroC26QjceW+P8t6q8hm9xUFKlIRVpfIJdzuzOXS8V+rxaOj KUJpGm1/MU1hMPCWCCtHRI2CyWrwBT/ac56O8m8k0itqnyDmLGVJxhbWKqM296bF909f J8cY3sgQhyBUl8szysbyHz6y5ejFP4w48pEdh0rq6g1dNWPxlJfkkW0gjffCQwNT59QB kcf+oHYGlqdSDZP9BnvVyv0WAQkEJAfS8lzh1+hkngWg3qRQ/ROm7lLYACeikgCfWHcG Q0AAco7AKq5cX4/j5NqoKUHWLMbLcLRnkyKqaCIuonImmcoP/gRFfqIxASFdUdkedCGY ClbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rnh9gOr05Dy78gNCBT1CMvjyeQ/F6wXvtpeRzjaiqKo=; b=hmPIzbZRrFC84+Jfl5REAVHAP07o66cxxFX4U1ftkkJdrvyvxipxMGG68iZQPfdgGL WUfFlRDTj/jdQ73VfFcB8rt/SixfKZ7UBfazFOwN052Tg2Qjz61nMq3mUnGeLuzJxwsp q5eUjEZ5ghdFQfa4pBILgiseYjAshaglJaC3DIqUyl/AH1sPjjE9Cc/ikezdAy+Lh2Nu /pDABh6i5+dmyJuv3/dNdRUIrSycQ1Uct8SBAnQBBXg8ZPIbps55eQGDDU5mYvJ+hvpq Rao1OoQ/Xo1/vSStRGSKqp/T09DHmQkenCWuzHOvk/GvX2aPx7N7mJ00VX5gFIhDUTT/ JO6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=qIqpC4iq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s188-20020a635ec5000000b004610dceee7fsi587666pgb.165.2022.11.17.01.22.24; Thu, 17 Nov 2022 01:22:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=qIqpC4iq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239684AbiKQInF (ORCPT + 92 others); Thu, 17 Nov 2022 03:43:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239616AbiKQImm (ORCPT ); Thu, 17 Nov 2022 03:42:42 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9210373437; Thu, 17 Nov 2022 00:42:41 -0800 (PST) Received: from pyrite.tail37cf.ts.net (h175-177-042-159.catv02.itscom.jp [175.177.42.159]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 52BF3929; Thu, 17 Nov 2022 09:42:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1668674560; bh=6nANnb2tFZVVVLtK7LKX6bWvaoeBArVUuO1Oxpluxjw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qIqpC4iqosbPtJ42CZ0+8TDCR/xAc5Bg9iIbqjt6rDSt9L0NYTuDgKsbozKFZa1oW h30+EW4tqG0NkHlE+TIghUNVV57nYgEmQHaV46ua/S+OygY6mN9M03y8OPPk5Lwwap 4w7k9MZriguUkJouFkUB+PD9Kdno9kgbLogvrbLI= From: Paul Elder To: linux-media@vger.kernel.org Cc: Laurent Pinchart , Dafna Hirschfeld , Mauro Carvalho Chehab , Heiko Stuebner , linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Paul Elder Subject: [PATCH v2 2/3] media: rkisp1: Make local immutable array variables static const Date: Thu, 17 Nov 2022 17:42:16 +0900 Message-Id: <20221117084217.3892680-3-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221117084217.3892680-1-paul.elder@ideasonboard.com> References: <20221117084217.3892680-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Laurent Pinchart The max_widths and max_heights variables in rkisp1_try_fmt() are immutable and don't need to be allocated on the stack every time the function is called. Make them static. Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder --- .../media/platform/rockchip/rkisp1/rkisp1-capture.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c index 7695ef134908..91e685fdbbe9 100644 --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c @@ -1150,13 +1150,17 @@ static void rkisp1_try_fmt(const struct rkisp1_capture *cap, const struct rkisp1_capture_fmt_cfg **fmt_cfg, const struct v4l2_format_info **fmt_info) { + static const unsigned int max_widths[] = { + RKISP1_RSZ_MP_SRC_MAX_WIDTH, + RKISP1_RSZ_SP_SRC_MAX_WIDTH, + }; + static const unsigned int max_heights[] = { + RKISP1_RSZ_MP_SRC_MAX_HEIGHT, + RKISP1_RSZ_SP_SRC_MAX_HEIGHT, + }; const struct rkisp1_capture_config *config = cap->config; const struct rkisp1_capture_fmt_cfg *fmt; const struct v4l2_format_info *info; - const unsigned int max_widths[] = { RKISP1_RSZ_MP_SRC_MAX_WIDTH, - RKISP1_RSZ_SP_SRC_MAX_WIDTH }; - const unsigned int max_heights[] = { RKISP1_RSZ_MP_SRC_MAX_HEIGHT, - RKISP1_RSZ_SP_SRC_MAX_HEIGHT}; fmt = rkisp1_find_fmt_cfg(cap, pixm->pixelformat); if (!fmt) { -- 2.35.1