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] [day] [month] [year] [list]
Message-ID: <A874F61F95741C4A9BA573A70FE3998FB8A7@DQHE02.ent.ti.com>
Date:	Tue, 19 Jun 2012 07:01:30 +0000
From:	"Kim, Milo" <Milo.Kim@...com>
To:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"Girdwood, Liam" <lrg@...com>
Subject: RE: [PATCH v2] regulator: add new regulator driver for lp872x

 
> > +	if (chip == LP8720) {
> > +		mask = LP8720_TIMESTEP_M;
> > +		shift = LP8720_TIMESTEP_S;
> > +		time_usec = &lp8720_time_usec[0];
> > +		size = ARRAY_SIZE(lp8720_time_usec);
> > +	} else if (chip == LP8725) {
> > +		mask = LP8725_TIMESTEP_M;
> > +		shift = LP8725_TIMESTEP_S;
> > +		time_usec = &lp8725_time_usec[0];
> > +		size = ARRAY_SIZE(lp8725_time_usec);
> > +	} else {
> > +		return -EINVAL;
> > +	}
> 
> This should be a switch statement.
> 
> > +static int lp8725_buck_set_current_limit(struct regulator_dev *rdev,
> > +					int min_uA, int max_uA)
> > +{
> > +	struct lp872x *lp = rdev_get_drvdata(rdev);
> > +	enum lp872x_regulator_id buck = rdev_get_id(rdev);
> > +	int i, max = ARRAY_SIZE(lp8725_buck_uA);
> > +	u8 addr, val;
> > +
> > +	if (buck == LP8725_ID_BUCK1)
> > +		addr = LP8725_BUCK1_VOUT2;
> > +	else if (buck == LP8725_ID_BUCK2)
> > +		addr = LP8725_BUCK2_VOUT2;
> > +	else
> > +		return -EINVAL;
> 
> Again, switch statement.
> 

In patch v3, some if-statements will be replaced with switch-statements.
Thank you.

Best Regards,
Milo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ