public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Robert Foss <rfoss@kernel.org>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Jonas Karlman <jonas@kwiboo.se>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Luca Ceresoli <luca.ceresoli@bootlin.com>,
	Daniel Stone <daniel@fooishbar.org>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	kernel@collabora.com
Subject: Re: [PATCH v3 4/4] drm/scdc-helper: Implement parsing and printing HDMI 2.1 fields
Date: Tue, 26 May 2026 16:56:14 +0300	[thread overview]
Message-ID: <ed3429c4ce492d9daf6b63ba7f1aa47a18e8f931@intel.com> (raw)
In-Reply-To: <DXw5qfHzRwWls-U9c30neg@collabora.com>

On Tue, 26 May 2026, Nicolas Frattaroli <nicolas.frattaroli@collabora.com> wrote:
> On Tuesday, 26 May 2026 12:52:31 Central European Summer Time Jani Nikula wrote:
>> On Tue, 26 May 2026, Nicolas Frattaroli <nicolas.frattaroli@collabora.com> wrote:
>> > +static __pure const char *drm_scdc_frl_rate_str(enum drm_scdc_frl_rate rate)
>> 
>> There are a total of only 71 __pure usages in the kernel. Is this
>> helpful for a static function where the compiler can figure it out by
>> itself?
>
> For the compiler, no. For the programmer, maybe. It's basically
> documentation that foo(x) remains the same for a specific x, so
> that having 3 calls with the same parameter in some scope is not
> actually 3 separate function calls, but just retrieving a value
> without manually saving it into a stack variable. A compiler can
> infer that in this case, but a programmer that has their LSP show
> them the function signature on hover will immediately know what's
> going on without having to look at the implementation.
>
> I have a habit of slapping it onto any function that is pure just
> because, but if you'd rather have me drop it then I can do that.
> I'm aware that slapping attributes onto function signatures can
> make them a bit noisy to read.

I'm not dead set on this.

But my observation, in general, is that setting an example is something
to be done with care. People try to do the right thing, and cargo
cult. And then you find out it's all over the place.

So IMO the question is not so much, "is it a good thing here", but
rather, "is this what we want for all pure functions".


BR,
Jani.


-- 
Jani Nikula, Intel

  reply	other threads:[~2026-05-26 13:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-26 10:19 [PATCH v3 0/4] Add SCDC information to connector debugfs Nicolas Frattaroli
2026-05-26 10:19 ` [PATCH v3 1/4] drm/scdc-helper: Don't use ssize_t return type for scdc_read/write Nicolas Frattaroli
2026-05-26 11:35   ` Luca Ceresoli
2026-05-27  5:01   ` Claude review: " Claude Code Review Bot
2026-05-26 10:19 ` [PATCH v3 2/4] drm/scdc-helper: Add scdc_status debugfs entry Nicolas Frattaroli
2026-05-26 10:48   ` Jani Nikula
2026-05-27  5:01   ` Claude review: " Claude Code Review Bot
2026-05-26 10:19 ` [PATCH v3 3/4] drm/display: bridge_connector: init scdc debugfs for HDMI Nicolas Frattaroli
2026-05-27  5:01   ` Claude review: " Claude Code Review Bot
2026-05-26 10:20 ` [PATCH v3 4/4] drm/scdc-helper: Implement parsing and printing HDMI 2.1 fields Nicolas Frattaroli
2026-05-26 10:52   ` Jani Nikula
2026-05-26 12:25     ` Nicolas Frattaroli
2026-05-26 13:56       ` Jani Nikula [this message]
2026-05-27  5:01   ` Claude review: " Claude Code Review Bot
2026-05-27  5:01 ` Claude review: Add SCDC information to connector debugfs Claude Code Review Bot

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=ed3429c4ce492d9daf6b63ba7f1aa47a18e8f931@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=daniel@fooishbar.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=nicolas.frattaroli@collabora.com \
    --cc=rfoss@kernel.org \
    --cc=simona@ffwll.ch \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox