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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 19 Jun 2023 13:37:31 +0300
From:   Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
To:     Andy Shevchenko <andriy.shevchenko@...el.com>
Cc:     linux-media@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-i2c@...r.kernel.org,
        Luca Ceresoli <luca.ceresoli@...tlin.com>,
        Matti Vaittinen <Matti.Vaittinen@...rohmeurope.com>,
        Laurent Pinchart <laurent.pinchart@...asonboard.com>,
        Sakari Ailus <sakari.ailus@...ux.intel.com>,
        Wolfram Sang <wsa@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Peter Rosin <peda@...ntia.se>,
        Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Michael Tretter <m.tretter@...gutronix.de>,
        Hans Verkuil <hverkuil@...all.nl>,
        Mike Pagano <mpagano@...too.org>,
        Krzysztof HaƂasa <khalasa@...p.pl>,
        Marek Vasut <marex@...x.de>,
        Satish Nagireddy <satish.nagireddy@...cruise.com>
Subject: Re: [PATCH v14 15/18] media: i2c: ds90ub953: Handle
 V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK

On 16/06/2023 17:33, Andy Shevchenko wrote:
> On Fri, Jun 16, 2023 at 04:59:19PM +0300, Tomi Valkeinen wrote:
>> Handle V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK flag to configure the CSI-2 RX
>> continuous/non-continuous clock register.
> 
> ...
> 
>>   	struct regmap		*regmap;
> 
> I forgot if we discussed this along with i2c_client *client nearby. Since I
> reviewed Hans' patches the pure struct device *dev (instead of *client) might
> make more sense, despite being duplicative with regmap associated device.
> 
>>   	u32			num_data_lanes;
>> +	bool			non_cont_clk;
>>   
>>   	struct gpio_chip	gpio_chip;
> 
> And also try to place this as a first member and see (by using bloat-o-meter,
> for example) if it saves bytes.
> 
> I'm wondering if we have tools like pahole but which suggests the better layout
> based on the code generation... Maybe something along with clang?

Isn't all this a bit on the side of pointless micro-optimizations? We're 
talking about possibly saving a few tens of bytes in a struct that's 
likely allocated a few times, by possibly messing up the (cosmetic) 
grouping and ordering of the fields in the struct?

If there's a common rule-of-thumb wrt. struct members that everyone 
should follow, I'm good with that and can change this accordingly. But 
just trying to hunt for a field order that happens to save a few bytes 
here... It doesn't sound like time well spent.

If things were perfect, this would be something the compiler would 
optimize, presuming the field ordering in the struct doesn't matter.

  Tomi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ