Message ID | 20221117084217.3892680-3-paul.elder@ideasonboard.com (mailing list archive) |
---|---|
State | Obsoleted |
Headers |
Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from <linux-media-owner@vger.kernel.org>) id 1ovaU4-00GU3o-PP; Thu, 17 Nov 2022 08:42:57 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239422AbiKQImw (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Thu, 17 Nov 2022 03:42:52 -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-media@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-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no |
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) {