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: Thu,  7 Mar 2024 14:43:10 +0530
From: Bhargav Raviprakash <bhargav.r@...s.com>
To: jpanis@...libre.com
Cc: arnd@...db.de,
	bhargav.r@...s.com,
	broonie@...nel.org,
	conor+dt@...nel.org,
	devicetree@...r.kernel.org,
	gregkh@...uxfoundation.org,
	kristo@...nel.org,
	krzysztof.kozlowski+dt@...aro.org,
	lee@...nel.org,
	lgirdwood@...il.com,
	linus.walleij@...aro.org,
	linux-arm-kernel@...ts.infradead.org,
	linux-gpio@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	m.nirmaladevi@...s.com,
	nm@...com,
	robh+dt@...nel.org,
	vigneshr@...com
Subject: Re: [PATCH v2 08/14] misc: tps6594-pfsm: Add TI TPS65224 PMIC PFSM

Hi,

On Mon, 26 Feb 2024 13:43:51 +0100, Julien Panis wrote:
> On 2/23/24 10:36, Bhargav Raviprakash wrote:
> > Add support for TPS65224 PFSM in the TPS6594 PFSM driver
> > as they share significant functionality.
> >
> > Signed-off-by: Bhargav Raviprakash <bhargav.r@...s.com>
> > ---
> >   drivers/misc/tps6594-pfsm.c | 55 +++++++++++++++++++++++++++----------
> >   1 file changed, 40 insertions(+), 15 deletions(-)
> >
> > diff --git a/drivers/misc/tps6594-pfsm.c b/drivers/misc/tps6594-pfsm.c
> > index 88dcac814..4fa071093 100644
> > --- a/drivers/misc/tps6594-pfsm.c
> > +++ b/drivers/misc/tps6594-pfsm.c
> > @@ -1,6 +1,6 @@
> >   // SPDX-License-Identifier: GPL-2.0
> >   /*
> > - * PFSM (Pre-configurable Finite State Machine) driver for TI TPS6594/TPS6593/LP8764 PMICs
> > + * PFSM (Pre-configurable Finite State Machine) driver for TI TPS65224/TPS6594/TPS6593/LP8764 PMICs
> >    *
> >    * Copyright (C) 2023 BayLibre Incorporated - https://www.baylibre.com/
> >    */
> > @@ -34,15 +34,17 @@
> >   
> >   #define TPS6594_FILE_TO_PFSM(f) container_of((f)->private_data, struct tps6594_pfsm, miscdev)
> >   
> > -/**
> > +/*
> 
> Here it should be /** for the structure documentation, I think.
> Please check in kernel doc.
>

Thanks for pointing it out! Will fix it in the next version.

> [...]
> 
> > @@ -210,8 +230,12 @@ static long tps6594_pfsm_ioctl(struct file *f, unsigned int cmd, unsigned long a
> >   			return ret;
> >   
> >   		/* Modify NSLEEP1-2 bits */
> > -		ret = regmap_clear_bits(pfsm->regmap, TPS6594_REG_FSM_NSLEEP_TRIGGERS,
> > -					TPS6594_BIT_NSLEEP2B);
> > +		if (pfsm->chip_id == TPS65224)
> > +			ret = regmap_clear_bits(pfsm->regmap, TPS6594_REG_FSM_NSLEEP_TRIGGERS,
> > +						TPS6594_BIT_NSLEEP1B);
> > +		else
> > +			ret = regmap_clear_bits(pfsm->regmap, TPS6594_REG_FSM_NSLEEP_TRIGGERS,
> > +						TPS6594_BIT_NSLEEP2B);
> 
> Instead of this if/else, a ternary operator might do the trick here:
> regmap_clear_bits(pfsm->regmap, TPS6594_REG_FSM_NSLEEP_TRIGGERS,
>                                pfsm->chip_id == TPS65224 ? TPS6594_BIT_NSLEEP1B : TPS6594_BIT_NSLEEP2B)
>
> Julien

Sure, this looks neat :-). We will use ternary operator here in the next version.
Thanks!

Regards,
Bhargav

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ