Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2373192rwb; Sat, 19 Nov 2022 14:50:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf7sP/J008NV6t/RkIIzYendDz3UqBN+VgTNmQGDPqA1ln3tEH3/SeaanwzVgVN1KesNbJw7 X-Received: by 2002:a05:6402:380b:b0:462:7b99:d3b2 with SMTP id es11-20020a056402380b00b004627b99d3b2mr10970042edb.248.1668898240024; Sat, 19 Nov 2022 14:50:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668898240; cv=none; d=google.com; s=arc-20160816; b=kuM+tCDbS78T0hwbSXry+VTZiZuKDQwwK+HJqD882lYOC9YoRY6Ng8e8cQvmPboWoq p6wdZAGie11xBD8l2N+CpemBe790uvBlAVXwSQeTw/Mo8Ey6CwaFg6cooz1Uc6+eNU++ oS+SPS0k+uHkTtGFK5khL2hUAM6bl/N791mwarn/ZSZXSx9xPbM1iTj+0Uu1gOqeK89D ITEQOtPvJ9bZ9wvntHfBe8xskwFnoyEVLolJVYoYyHdGVlz4ZhmBxnfsvX3k3c5XA8KJ sCw1Gdnnwe0IRrbT8YgFBOL/DhvjARMt0kP9pD1uyJKzPoHGe3nNQwOfwxgePlWwIy6x mVKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=OobMinPe60MgLM65TcA6lbQL6oh30nF9loFnJ5P9P24=; b=SBm2PPDHGWsMQ/vmydWm2dAS2HZi2gjVFnoH9omLTq+XBULfLh4PvyBVZ3MvY3NteI tGxaHzTqZ0qYSrA9cvKm45F/drd81+WiyIv0Doe7f8soi3cQ1UvjIDP/For6iaZTUQGj bWl7/kG/53wQQ6dOcgPW/U+AXNJ3S/iCF861bozEqZ99ZBBdHy5mR+H0hcFjQ+g+Z+11 n1SExbVkXlw2//AiGJpFFZTi83w/SGJySuDuc6vg0DfW0L28r0bh1rMGRSScDXgTRLuB ftkO9fs5kJzqookO6wl4jw8Nz2aRSlispyiBG03RbBerkjmiUPXatiiw/sh5vnE0tEZa xkPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=lRbem7e6; 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 ae9-20020a17090725c900b007ad88f87f07si7084910ejc.599.2022.11.19.14.50.17; Sat, 19 Nov 2022 14:50:40 -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=lRbem7e6; 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 S234219AbiKSW2Y (ORCPT + 90 others); Sat, 19 Nov 2022 17:28:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229635AbiKSW2W (ORCPT ); Sat, 19 Nov 2022 17:28:22 -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 98A151902D; Sat, 19 Nov 2022 14:28:21 -0800 (PST) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E8C39749; Sat, 19 Nov 2022 23:28:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1668896898; bh=5lAZjq/Qa546GFzmky2g0r1fpVjt3znao3kF2DJgorU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lRbem7e6no7CZC6tGJHSggi+AYgWUb1fjX2iTUOa9dex8S3pEAB7aNk9x4l8XIT8A +aYh8Dmo2QPwwXErCY5fV6fyY+zEG8eJZ20Z6wl7j8v9oPxOXpRhUe9l7E4nVzz0px MC45fVXZJWKeiAegECFNe+30kb1xo2fi0JgGXnQs= Date: Sun, 20 Nov 2022 00:28:01 +0200 From: Laurent Pinchart To: Dafna Hirschfeld Cc: Paul Elder , linux-media@vger.kernel.org, Mauro Carvalho Chehab , Heiko Stuebner , linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/3] media: rkisp1: Make local immutable array variables static const Message-ID: References: <20221117084217.3892680-1-paul.elder@ideasonboard.com> <20221117084217.3892680-3-paul.elder@ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20221117084217.3892680-3-paul.elder@ideasonboard.com> 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 Hi Dafna, Are you fine with this patch, can I include it in my next pull request along with the other ones from the series ? On Thu, Nov 17, 2022 at 05:42:16PM +0900, Paul Elder wrote: > 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 > -- Regards, Laurent Pinchart