public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Kieran Bingham <kieran.bingham@ideasonboard.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Kate Hsuan <hpa@redhat.com>, Tsuchiya Yuto <kitakar@gmail.com>,
	Fabio Aiuto <fabioaiuto83@gmail.com>,
	linux-media@vger.kernel.org, linux-staging@lists.linux.dev
Subject: Re: [PATCH 11/23] media: atomisp: Remove test pattern generator (TPG) support
Date: Tue, 16 Apr 2024 17:50:34 +0300	[thread overview]
Message-ID: <Zh6QOmFbeC-G6RMe@smile.fi.intel.com> (raw)
In-Reply-To: <171327844339.342316.3750832654489118780@ping.linuxembedded.co.uk>

On Tue, Apr 16, 2024 at 03:40:43PM +0100, Kieran Bingham wrote:
> Quoting Kieran Bingham (2024-04-16 15:37:39)
> > Quoting Andy Shevchenko (2024-04-16 14:34:45)
> > > On Tue, Apr 16, 2024 at 12:25 PM Hans de Goede <hdegoede@redhat.com> wrote:
> > > > On 4/15/24 4:40 PM, Andy Shevchenko wrote:
> > > > > On Mon, Apr 15, 2024 at 02:02:08PM +0200, Hans de Goede wrote:

...

> > > > >>              unsigned int hblank_cycles = 100,
> > > > >>              vblank_lines = 6,
> > > > >>              width,
> > > > >
> > > > > Urgh... These comma operators probably is subject to replace with separate
> > > > > definitions or being grouped on a single line (as it suppose to be in this
> > > > > case).
> > > >
> > > > That indeed is ugly, but fixing this is out of scope for this patch,
> > > > so I've added an extra patch to the set to address this:
> > > >
> > > > https://git.kernel.org/pub/scm/linux/kernel/git/hansg/linux.git/commit/?h=media-atomisp&id=48d93af9d9b0fd40a21a656cb8cd8e25700bfed5
> > > 
> > > WFM, thanks!
> > > 
> > > Btw (yes, I see you tagged that already, so just FYI then)
> > > (1 + (stream->config.pixels_per_clock == 2));
> > > is an interesting way of using
> > > 
> > >  (stream->config.pixels_per_clock == 2) ? 2 : 1);
> > > 
> > > which likely can produce slightly better code (due to use of constant
> > > 2 twice), although it is a pure speculation by me.
> 
> Ooops, I didn't mean to send that. Well I wrote something but then
> closed it when I wasn't going to bother and instead some how sent an
> empty mail ..
> 
> So now I guess I should actually say what I wasn't going to end up
> saying? haha.
> 
> This was too intriguing (to me) so I threw it in godbolt, and for
> various levels of compiler optimsations, both options generate the same
> code, even with -O0. Of course the different optimsation levels produce
> different code, but the two options above always match at the given
> level.

Thanks for playing with this.

The issue with the original code is readability and potential oddity about
boolean to integer conversion. That said, I prefer my variant for the sake
of clarity.

> Fun with godbolt ;-)
> 
> https://godbolt.org/z/hYjrvK6hn

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2024-04-16 14:50 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15 12:01 [PATCH 00/23] media: atomisp: Further media-controller related fixes + dead code removal Hans de Goede
2024-04-15 12:01 ` [PATCH 01/23] media: atomisp: Add atomisp_s_sensor_power() helper Hans de Goede
2024-04-15 12:01 ` [PATCH 02/23] media: atomisp: Turn on sensor power from atomisp_set_fmt() Hans de Goede
2024-04-15 12:02 ` [PATCH 03/23] media: atomisp: Add atomisp_select_input() helper Hans de Goede
2024-04-15 12:02 ` [PATCH 04/23] media: atomisp: Simplify atomisp_s_input() input argument checking Hans de Goede
2024-04-15 12:02 ` [PATCH 05/23] media: atomisp: Ensure CSI-receiver[x] -> ISP links correctly reflect current sensor Hans de Goede
2024-04-15 12:02 ` [PATCH 06/23] media: atomisp: Propagate set_fmt on sensor results to CSI port Hans de Goede
2024-04-15 12:02 ` [PATCH 07/23] media: atomisp: Propagate v4l2_mbus_framefmt.field to CSI port sink pad Hans de Goede
2024-04-15 12:02 ` [PATCH 08/23] media: atomisp: Call media_pipeline_alloc_start() in stream start Hans de Goede
2024-04-15 12:02 ` [PATCH 09/23] media: atomisp: Drop atomisp_pipe_check() from atomisp_link_setup() Hans de Goede
2024-04-15 12:02 ` [PATCH 10/23] media: atomisp: ov2722: Remove power on sensor from set_fmt() callback Hans de Goede
2024-04-15 12:02 ` [PATCH 11/23] media: atomisp: Remove test pattern generator (TPG) support Hans de Goede
2024-04-15 14:40   ` Andy Shevchenko
2024-04-16  9:25     ` Hans de Goede
2024-04-16 13:34       ` Andy Shevchenko
2024-04-16 14:37         ` Kieran Bingham
2024-04-16 14:40           ` Kieran Bingham
2024-04-16 14:50             ` Andy Shevchenko [this message]
2024-04-16 14:52               ` Andy Shevchenko
2024-04-15 12:02 ` [PATCH 12/23] media: atomisp: Remove input_port_ID_t Hans de Goede
2024-04-15 12:02 ` [PATCH 13/23] media: atomisp: Drop the atomisp custom lm3554 flash driver Hans de Goede
2024-04-15 14:49   ` Andy Shevchenko
2024-04-15 14:50     ` Andy Shevchenko
2024-04-15 12:02 ` [PATCH 14/23] media: atomisp: Drop custom flash support Hans de Goede
2024-04-15 14:53   ` Andy Shevchenko
2024-04-15 12:02 ` [PATCH 15/23] media: atomisp: Drop unused frame_status tracking Hans de Goede
2024-04-15 12:02 ` [PATCH 16/23] media: atomisp: Drop intel_v4l2_subdev_type Hans de Goede
2024-04-15 14:55   ` Andy Shevchenko
2024-04-15 12:02 ` [PATCH 17/23] media: atomisp: Remove gmin_platform VCM code Hans de Goede
2024-04-15 12:02 ` [PATCH 18/23] media: atomisp: Remove struct atomisp_platform_data Hans de Goede
2024-04-15 12:02 ` [PATCH 19/23] media: atomisp: Remove clearing of ISP crop / compose rectangles on file release Hans de Goede
2024-04-15 12:02 ` [PATCH 20/23] media: atomisp: Remove empty s_power() op from ISP subdev Hans de Goede
2024-04-15 12:02 ` [PATCH 21/23] media: atomisp: Remove empty s_stream() op from CSI subdev Hans de Goede
2024-04-15 12:02 ` [PATCH 22/23] media: atomisp: Cleanup atomisp_isr_thread() spinlock handling Hans de Goede
2024-04-15 12:02 ` [PATCH 23/23] media: atomisp: Remove setting of f->fmt.pix.priv from atomisp_set_fmt() Hans de Goede
2024-04-15 14:58 ` [PATCH 00/23] media: atomisp: Further media-controller related fixes + dead code removal Andy Shevchenko

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=Zh6QOmFbeC-G6RMe@smile.fi.intel.com \
    --to=andy.shevchenko@gmail.com \
    --cc=fabioaiuto83@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=hpa@redhat.com \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=kitakar@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    /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