Linux Media Controller development
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-media@vger.kernel.org,
	Kieran Bingham <kieran.bingham@ideasonboard.com>,
	Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH v1 1/9] media: vimc: Don't iterate over single pad
Date: Thu, 30 May 2024 14:18:05 -0600	[thread overview]
Message-ID: <339ab149-6cfc-498e-9650-e72e7e2cd039@linuxfoundation.org> (raw)
In-Reply-To: <20240530194515.GA28160@pendragon.ideasonboard.com>

On 5/30/24 13:45, Laurent Pinchart wrote:
> Hi Shuah,
> 
> On Thu, May 30, 2024 at 01:27:53PM -0600, Shuah Khan wrote:
>> On 4/24/24 17:57, Laurent Pinchart wrote:
>>> The .init_state() operations of the debayer and sensor entities iterate
>>> over the entity's pads. In practice, the iteration covers a single pad
>>> only. Access the pad directly and remove the loops.
>>
>> I am not seeing much of a reason to do this. This code is good
>> even when num_pads change.
>>
>> Don't change the loops.
> 
> Why so ? Beside the fact that the loop wastes some CPU cycles, the
> current code implies that there would be multiple source pads, which is
> confusing for the reader. I think the result of this patch is both
> improved efficiency and improved readability.

It is currently flexible and if and when more pads get added,
there is no need to change it. I am not concerned about the
efficiency on this test driver. Also people use the test
driver as a sample.

Please leave it the way it is.

thanks,
-- Shuah

  reply	other threads:[~2024-05-30 20:18 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-24 23:57 [PATCH v1 0/9] media: vimc improvements Laurent Pinchart
2024-04-24 23:57 ` [PATCH v1 1/9] media: vimc: Don't iterate over single pad Laurent Pinchart
2024-05-30 19:27   ` Shuah Khan
2024-05-30 19:45     ` Laurent Pinchart
2024-05-30 20:18       ` Shuah Khan [this message]
2024-05-30 20:21         ` Laurent Pinchart
2024-05-30 20:58           ` Shuah Khan
2024-06-20 10:47           ` Hans Verkuil
2024-06-20 13:00             ` Sakari Ailus
2024-06-20 15:33               ` Shuah Khan
2024-06-20 13:01   ` Sakari Ailus
2024-04-24 23:57 ` [PATCH v1 2/9] media: vimc: Constify vimc_ent_type structures Laurent Pinchart
2024-05-30 19:28   ` Shuah Khan
2024-04-24 23:57 ` [PATCH v1 3/9] media: vimc: Constify the ent_config array Laurent Pinchart
2024-05-30 19:29   ` Shuah Khan
2024-04-24 23:57 ` [PATCH v1 4/9] media: vimc: scaler: Rename vic_sca_pad enum to vimc_scaler_pad Laurent Pinchart
2024-05-30 19:29   ` Shuah Khan
2024-04-24 23:57 ` [PATCH v1 5/9] media: vimc: Centralize subdev internal_ops initialization Laurent Pinchart
2024-05-30 19:31   ` Shuah Khan
2024-04-24 23:57 ` [PATCH v1 6/9] media: vimc: Initialize subdev active state Laurent Pinchart
2024-04-24 23:57 ` [PATCH v1 7/9] media: vimc: sensor: Use " Laurent Pinchart
2024-04-24 23:57 ` [PATCH v1 8/9] media: vimc: debayer: " Laurent Pinchart
2024-04-24 23:57 ` [PATCH v1 9/9] media: vimc: scaler: " Laurent Pinchart
2024-05-05 20:36 ` [PATCH v1 0/9] media: vimc improvements Laurent Pinchart
2024-05-28 15:49   ` Shuah Khan
2024-05-30 19:34 ` Shuah Khan
2024-06-20 15:59 ` Shuah Khan
2024-06-20 16:09   ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=339ab149-6cfc-498e-9650-e72e7e2cd039@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox