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: <Y8pZfCqiuU+HFs+v@pendragon.ideasonboard.com>
Date:   Fri, 20 Jan 2023 11:06:04 +0200
From:   Laurent Pinchart <laurent.pinchart@...asonboard.com>
To:     Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
Cc:     linux-media@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-i2c@...r.kernel.org,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Wolfram Sang <wsa@...nel.org>,
        Luca Ceresoli <luca.ceresoli@...tlin.com>,
        Andy Shevchenko <andriy.shevchenko@...el.com>,
        Matti Vaittinen <Matti.Vaittinen@...rohmeurope.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Peter Rosin <peda@...ntia.se>,
        Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Sakari Ailus <sakari.ailus@...ux.intel.com>,
        Michael Tretter <m.tretter@...gutronix.de>,
        Shawn Tu <shawnx.tu@...el.com>,
        Hans Verkuil <hverkuil@...all.nl>,
        Mike Pagano <mpagano@...too.org>,
        Krzysztof HaƂasa <khalasa@...p.pl>,
        Marek Vasut <marex@...x.de>
Subject: Re: [PATCH v7 6/7] media: i2c: add DS90UB913 driver

Hi Tomi,

On Fri, Jan 20, 2023 at 09:04:39AM +0200, Tomi Valkeinen wrote:
> On 20/01/2023 02:03, Laurent Pinchart wrote:
> > On Wed, Jan 18, 2023 at 02:40:30PM +0200, Tomi Valkeinen wrote:
> >> Add driver for TI DS90UB913 FPD-Link III Serializer.
> >>
> >> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
> >> ---
> >>   drivers/media/i2c/Kconfig     |  13 +
> >>   drivers/media/i2c/Makefile    |   1 +
> >>   drivers/media/i2c/ds90ub913.c | 848 ++++++++++++++++++++++++++++++++++
> >>   3 files changed, 862 insertions(+)
> >>   create mode 100644 drivers/media/i2c/ds90ub913.c

[snip]

> >> diff --git a/drivers/media/i2c/ds90ub913.c b/drivers/media/i2c/ds90ub913.c
> >> new file mode 100644
> >> index 000000000000..befa78128a9a
> >> --- /dev/null
> >> +++ b/drivers/media/i2c/ds90ub913.c
> >> @@ -0,0 +1,848 @@

[snip]

> >> +static int ub913_gpio_direction_out(struct gpio_chip *gc, unsigned int offset,
> >> +				    int value)
> >> +{
> >> +	struct ub913_data *priv = gpiochip_get_data(gc);
> >> +	unsigned int reg_idx = offset / 2;
> >> +	unsigned int field_idx = offset % 2;
> >> +
> >> +	return regmap_update_bits(priv->regmap, UB913_REG_GPIO_CFG(reg_idx),
> >> +				  UB913_REG_GPIO_CFG_MASK(field_idx),
> >> +				  UB913_REG_GPIO_CFG_ENABLE(field_idx) |
> >> +					  (value ? UB913_REG_GPIO_CFG_OUT_VAL(field_idx) :
> >> +						   0));
> > 
> > I find the indentation weird, I would have written
> > 
> > 	return regmap_update_bits(priv->regmap, UB913_REG_GPIO_CFG(reg_idx),
> > 				  UB913_REG_GPIO_CFG_MASK(field_idx),
> > 				  UB913_REG_GPIO_CFG_ENABLE(field_idx) |
> > 				  (value ? UB913_REG_GPIO_CFG_OUT_VAL(field_idx) : 0));
> > 
> > Your call.
> 
> It's clang-format. I still haven't found out how to make it indent as 
> I'd like. Actually, with kernel's clang-format settings this ends up as:
> 
> return regmap_update_bits(
> 	priv->regmap, UB913_REG_GPIO_CFG(reg_idx),
> 	UB913_REG_GPIO_CFG_MASK(field_idx),
> 	UB913_REG_GPIO_CFG_ENABLE(field_idx) |
> 		(value ? UB913_REG_GPIO_CFG_OUT_VAL(field_idx) : 0));

That's horrible indeed.

> But checkpatch complains about line ending with (. Adjusting the 
> settings a bit I got it to indent as it is currently.

It's lovely when tools work together as expected, right ? :-)

> The indent after the line ending with | make sense, I think, but I don't 
> mind your formatting either.

I don't think I've seen that style before. If you prefer it, your code,
your style :-) Just be consistent through the driver in that case.

> >> +}

[snip]

-- 
Regards,

Laurent Pinchart

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ