All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Marek Vasut <marek.vasut@mailbox.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	Marek Vasut <marek.vasut+renesas@mailbox.org>,
	dri-devel@lists.freedesktop.org, David Airlie <airlied@gmail.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Magnus Damm <magnus.damm@gmail.com>,
	Maxime Ripard <mripard@kernel.org>,
	Simona Vetter <simona@ffwll.ch>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH 2/9] drm/rcar-du: dsi: Deduplicate mipi_dsi_pixel_format_to_bpp() usage
Date: Tue, 23 Sep 2025 11:57:12 +0300	[thread overview]
Message-ID: <20250923085712.GB20765@pendragon.ideasonboard.com> (raw)
In-Reply-To: <241530bb-7c06-4055-b95b-83a89f27895b@mailbox.org>

On Tue, Sep 23, 2025 at 10:55:20AM +0200, Marek Vasut wrote:
> On 9/23/25 8:47 AM, Geert Uytterhoeven wrote:
> 
> Hello Geert,
> 
> >> @@ -457,11 +458,11 @@ static void rcar_mipi_dsi_set_display_timing(struct rcar_mipi_dsi *dsi,
> >>          u32 vprmset4r;
> >>
> >>          /* Configuration for Pixel Stream and Packet Header */
> >> -       if (mipi_dsi_pixel_format_to_bpp(dsi->format) == 24)
> >> +       if (dsibpp == 24)
> >>                  rcar_mipi_dsi_write(dsi, TXVMPSPHSETR, TXVMPSPHSETR_DT_RGB24);
> >> -       else if (mipi_dsi_pixel_format_to_bpp(dsi->format) == 18)
> >> +       else if (dsibpp == 18)
> >>                  rcar_mipi_dsi_write(dsi, TXVMPSPHSETR, TXVMPSPHSETR_DT_RGB18);
> >> -       else if (mipi_dsi_pixel_format_to_bpp(dsi->format) == 16)
> >> +       else if (dsibpp == 16)
> > 
> > What about using the switch() statement instead?
> 
> Not for single-line bodies in the conditionals. The switch {} statement 
> would require additional break; in each case and that's not worth it 
> here, it would only add noise into the code.

I'm a bit surprised. I don't mind much as I don't work on this driver
myself, but for what it's worth I would find a switch statement to be
more readable too. Coding style is of course a matter of personal
preference in many cases.

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2025-09-23  8:57 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-22 18:54 [PATCH 0/9] drm/rcar-du: dsi: Convert register bits to BIT()/GENMASK() macros Marek Vasut
2025-09-22 18:54 ` [PATCH 1/9] drm/rcar-du: dsi: Fix missing parameter in RXSETR_...EN macros Marek Vasut
2025-09-23 11:42   ` Laurent Pinchart
2025-09-22 18:54 ` [PATCH 2/9] drm/rcar-du: dsi: Deduplicate mipi_dsi_pixel_format_to_bpp() usage Marek Vasut
2025-09-23  6:47   ` Geert Uytterhoeven
2025-09-23  8:55     ` Marek Vasut
2025-09-23  8:57       ` Laurent Pinchart [this message]
2025-09-23  9:02         ` Geert Uytterhoeven
2025-09-22 18:54 ` [PATCH 3/9] drm/rcar-du: dsi: Clean up VCLKSET register macros Marek Vasut
2025-09-23  9:10   ` kernel test robot
2025-09-23 11:49   ` Laurent Pinchart
2025-09-24  0:00     ` Marek Vasut
2025-09-22 18:55 ` [PATCH 4/9] drm/rcar-du: dsi: Clean up CLOCKSET1 CLKINSEL macros Marek Vasut
2025-09-23  5:45   ` Biju Das
2025-09-23  8:58     ` Marek Vasut
2025-09-23  9:04       ` Biju Das
2025-09-23  9:11         ` Marek Vasut
2025-09-22 18:55 ` [PATCH 5/9] drm/rcar-du: dsi: Clean up TXVMPSPHSETR DT macros Marek Vasut
2025-09-23 11:52   ` Laurent Pinchart
2025-09-22 18:55 ` [PATCH 6/9] drm/rcar-du: dsi: Respect DSI mode flags Marek Vasut
2025-09-23 11:54   ` Laurent Pinchart
2025-09-22 18:55 ` [PATCH 7/9] drm/rcar-du: dsi: Clean up handling of DRM " Marek Vasut
2025-09-23 13:26   ` Laurent Pinchart
2025-09-24  0:12     ` Marek Vasut
2025-09-24  1:18     ` Sebastian Reichel
2025-09-24  2:36       ` Marek Vasut
2025-09-24 20:53         ` Laurent Pinchart
2025-09-22 18:55 ` [PATCH 8/9] drm/rcar-du: dsi: Convert register bits to BIT() macro Marek Vasut
2025-09-23 14:16   ` Laurent Pinchart
2025-09-24  0:34     ` Marek Vasut
2025-09-22 18:55 ` [PATCH 9/9] drm/rcar-du: dsi: Convert register bitfields to GENMASK() macro Marek Vasut

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=20250923085712.GB20765@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=magnus.damm@gmail.com \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=marek.vasut@mailbox.org \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tomi.valkeinen+renesas@ideasonboard.com \
    --cc=tzimmermann@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.