From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: "Hans Verkuil" <hverkuil@xs4all.nl>,
"Mauro Carvalho Chehab" <mchehab@kernel.org>,
"Tomasz Figa" <tfiga@chromium.org>,
"Marek Szyprowski" <m.szyprowski@samsung.com>,
"Maxim Levitsky" <maximlevitsky@gmail.com>,
"Sean Young" <sean@mess.org>,
"Olli Salonen" <olli.salonen@iki.fi>,
"Abylay Ospan" <aospan@amazon.com>,
"Jemma Denson" <jdenson@gmail.com>,
"Patrick Boettcher" <patrick.boettcher@posteo.de>,
"Jacopo Mondi" <jacopo+renesas@jmondi.org>,
"Kieran Bingham" <kieran.bingham+renesas@ideasonboard.com>,
"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>,
"Tim Harvey" <tharvey@gateworks.com>,
"Andy Walls" <awalls@md.metrocast.net>,
"Sakari Ailus" <sakari.ailus@linux.intel.com>,
"Bingbu Cao" <bingbu.cao@intel.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/6] media: platform: Use str_enable_disable-like helpers
Date: Wed, 15 Jan 2025 09:44:46 +0200 [thread overview]
Message-ID: <20250115074446.GE29541@pendragon.ideasonboard.com> (raw)
In-Reply-To: <4c79c0e4-dbe9-4f4e-8b2a-a5cf58d49a7c@linaro.org>
On Tue, Jan 14, 2025 at 10:06:15PM +0100, Krzysztof Kozlowski wrote:
> On 14/01/2025 21:42, Laurent Pinchart wrote:
> > Hi Krzysztof,
> >
> > Thank you for the patch.
> >
> > On Tue, Jan 14, 2025 at 08:46:21PM +0100, Krzysztof Kozlowski wrote:
> >> Replace ternary (condition ? "enable" : "disable") syntax with helpers
> >> from string_choices.h because:
> >> 1. Simple function call with one argument is easier to read. Ternary
> >> operator has three arguments and with wrapping might lead to quite
> >> long code.
> >
> > It's more difficult to read for me.
>
> That's obviously subjective, but I am surprised that such stuff is
> readable for you:
>
> data & XCSI_DLXINFR_SOTERR ? "true" : "false",
> video->hq_mode ? "on" : "off", video->jpeg_hq_quality);
>
> or from PCI parts of this set, note that's ternary is split here:
>
> dstat & BT848_DSTATUS_HLOC
> ? "yes" : "no");
That's likely due to being used to reading those constructs, and is
certainly subjective. I can't tell what option would objectively be
best, but I have a feeling there's actually no objective best.
> >> 2. Is slightly shorter thus also easier to read.
> >> 3. It brings uniformity in the text - same string.
> >> 4. Allows deduping by the linker, which results in a smaller binary
> >> file.
> >
> > I don't see why the linker can't de-dup string in the current code.
> >
> > I'm sorry, I just don't see the point in doing this. I'd like to avoid
> > those changes in the Linux media subsystem, or at the very least in
> > drivers I maintain.
>
> Ack.
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2025-01-15 7:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-14 19:46 [PATCH 0/6] media: " Krzysztof Kozlowski
2025-01-14 19:46 ` [PATCH 1/6] " Krzysztof Kozlowski
2025-01-14 19:46 ` [PATCH 2/6] media: dvb: " Krzysztof Kozlowski
2025-01-14 19:46 ` [PATCH 3/6] media: i2c: " Krzysztof Kozlowski
2025-01-14 19:46 ` [PATCH 4/6] media: pci: " Krzysztof Kozlowski
2025-01-14 19:46 ` [PATCH 5/6] media: platform: " Krzysztof Kozlowski
2025-01-14 20:42 ` Laurent Pinchart
2025-01-14 21:06 ` Krzysztof Kozlowski
2025-01-15 7:44 ` Laurent Pinchart [this message]
2025-01-15 7:39 ` Sakari Ailus
2025-01-15 7:47 ` Tomasz Figa
2025-02-20 13:51 ` Hans Verkuil
2025-01-14 19:46 ` [PATCH 6/6] media: usb: " Krzysztof Kozlowski
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=20250115074446.GE29541@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=aospan@amazon.com \
--cc=awalls@md.metrocast.net \
--cc=bingbu.cao@intel.com \
--cc=hverkuil@xs4all.nl \
--cc=jacopo+renesas@jmondi.org \
--cc=jdenson@gmail.com \
--cc=kieran.bingham+renesas@ideasonboard.com \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=maximlevitsky@gmail.com \
--cc=mchehab@kernel.org \
--cc=niklas.soderlund+renesas@ragnatech.se \
--cc=olli.salonen@iki.fi \
--cc=patrick.boettcher@posteo.de \
--cc=sakari.ailus@linux.intel.com \
--cc=sean@mess.org \
--cc=tfiga@chromium.org \
--cc=tharvey@gateworks.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
all inboxes | Powered by JetHome®