lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250115074446.GE29541@pendragon.ideasonboard.com>
Date: Wed, 15 Jan 2025 09:44:46 +0200
From: Laurent Pinchart <laurent.pinchart@...asonboard.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Cc: Hans Verkuil <hverkuil@...all.nl>,
	Mauro Carvalho Chehab <mchehab@...nel.org>,
	Tomasz Figa <tfiga@...omium.org>,
	Marek Szyprowski <m.szyprowski@...sung.com>,
	Maxim Levitsky <maximlevitsky@...il.com>,
	Sean Young <sean@...s.org>, Olli Salonen <olli.salonen@....fi>,
	Abylay Ospan <aospan@...zon.com>, Jemma Denson <jdenson@...il.com>,
	Patrick Boettcher <patrick.boettcher@...teo.de>,
	Jacopo Mondi <jacopo+renesas@...ndi.org>,
	Kieran Bingham <kieran.bingham+renesas@...asonboard.com>,
	Niklas Söderlund <niklas.soderlund+renesas@...natech.se>,
	Tim Harvey <tharvey@...eworks.com>,
	Andy Walls <awalls@...metrocast.net>,
	Sakari Ailus <sakari.ailus@...ux.intel.com>,
	Bingbu Cao <bingbu.cao@...el.com>, linux-media@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 5/6] media: platform: Use str_enable_disable-like helpers

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ