Message ID | 20221117084217.3892680-3-paul.elder@ideasonboard.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp284977wrr; Thu, 17 Nov 2022 00:45:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf4bn/kcjHy0MDYFzXjX32tjMMhPuk2YS86GpcTh31m3z1tGe8+hgO1dT+MO8L2XcEx1eo7g X-Received: by 2002:a17:90b:3549:b0:212:fa9a:3c47 with SMTP id lt9-20020a17090b354900b00212fa9a3c47mr1821797pjb.41.1668674744492; Thu, 17 Nov 2022 00:45:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668674744; cv=none; d=google.com; s=arc-20160816; b=fVLqCYgOlu+t3NHfQ91sEicpdMu5WI3kjTjJGtp/X1B5LUVn20C80QmieMXp5xQjjJ NnEz7gcU3vRZ/Na8qya46JUCYyaG4yudVSrBeHGfbuxjy71dXvfmGteeHOT3gqeLizOD qQ8VDauz9p7GP6VyzLATxD5pdzs9zW8pD6TUd3nxjR/wZRISCHWEUfSwN1NlxC7QeRYg npzVO0wWZ3L/kCz3uopkG9Mb6diywK6XErzYtzqbr+h++y1f09ylETxjQ8co1J/Pq3XN Q7YuV/VY144ED8pBxDkoEtVKekawKIPo8W5fLux5xM7Dnyey+qSI4oUQZzlItMPwPfJB 6Klw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b16-20020a170902d51000b0018666611f85si465323plg.508.2022.11.17.00.45.32; Thu, 17 Nov 2022 00:45:44 -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 <rfc822;anhang610@gmail.com> + 99 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <paul.elder@ideasonboard.com> To: linux-media@vger.kernel.org Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>, Dafna Hirschfeld <dafna@fastmail.com>, Mauro Carvalho Chehab <mchehab@kernel.org>, Heiko Stuebner <heiko@sntech.de>, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Paul Elder <paul.elder@ideasonboard.com> 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749732288896226849?= X-GMAIL-MSGID: =?utf-8?q?1749732288896226849?= |
Series |
media: rkisp1: Miscellaneous improvements
|
|
Commit Message
Paul Elder
Nov. 17, 2022, 8:42 a.m. UTC
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com> 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 <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> --- .../media/platform/rockchip/rkisp1/rkisp1-capture.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
Comments
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 <laurent.pinchart@ideasonboard.com> > > 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 <laurent.pinchart@ideasonboard.com> > Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> > --- > .../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 >
Hi Dafna, On Sun, Nov 20, 2022 at 12:28:01AM +0200, Laurent Pinchart wrote: > 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 ? Ping. > On Thu, Nov 17, 2022 at 05:42:16PM +0900, Paul Elder wrote: > > From: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > > > 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 <laurent.pinchart@ideasonboard.com> > > Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> > > --- > > .../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) {
Hello the change seems trivial, do we need an explicit ack from Dafna ? Dafna are you comfortable being listed as maintainer of this driver or do you think you won't be able to dedicate time to it and need help ? Thanks j On Fri, Jan 27, 2023 at 01:28:05AM +0200, Laurent Pinchart wrote: > Hi Dafna, > > On Sun, Nov 20, 2022 at 12:28:01AM +0200, Laurent Pinchart wrote: > > 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 ? > > Ping. > > > On Thu, Nov 17, 2022 at 05:42:16PM +0900, Paul Elder wrote: > > > From: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > > > > > 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 <laurent.pinchart@ideasonboard.com> > > > Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> > > > --- > > > .../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) { > > -- > Regards, > > Laurent Pinchart
Hi Jacopo, On Fri, Mar 24, 2023 at 11:37:44AM +0100, Jacopo Mondi wrote: > Hello > the change seems trivial, do we need an explicit ack from Dafna ? An alternative patch has been merged in commit 4ee8191c7c9f ("media: rkisp1: make a few const arrays static"). > Dafna are you comfortable being listed as maintainer of this driver or > do you think you won't be able to dedicate time to it and need help ? > > Thanks > j > > On Fri, Jan 27, 2023 at 01:28:05AM +0200, Laurent Pinchart wrote: > > On Sun, Nov 20, 2022 at 12:28:01AM +0200, Laurent Pinchart wrote: > > > 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 ? > > > > Ping. > > > > > On Thu, Nov 17, 2022 at 05:42:16PM +0900, Paul Elder wrote: > > > > From: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > > > > > > > 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 <laurent.pinchart@ideasonboard.com> > > > > Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> > > > > --- > > > > .../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) {
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) {