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]
Date:	Wed, 28 May 2014 12:19:45 +0100
From:	Mark Brown <broonie@...nel.org>
To:	"Zhu, Lejun" <lejun.zhu@...ux.intel.com>
Cc:	lee.jones@...aro.org, sameo@...ux.intel.com,
	linux-kernel@...r.kernel.org, jacob.jun.pan@...ux.intel.com,
	bin.yang@...el.com
Subject: Re: [PATCH RESEND v2 1/4] mfd: intel_soc_pmic: Core driver

On Wed, May 28, 2014 at 08:55:11AM +0800, Zhu, Lejun wrote:

> Oh I see. Sorry I missed your point. So you are saying "int
> intel_soc_pmic_readb(int reg)" is bad, but if I have:

> int intel_soc_pmic_readb(struct intel_soc_pmic *pmic, int reg)
> {
> 	int ret;
> 	unsigned int val;
> 
> 	ret = regmap_read(pmic->regmap, reg, &val);
> 	if (!ret)
> 		ret = val;
> 
> 	return ret;
> }

> And have the caller (device or core) look up and pass *pmic in, this
> will be OK?

Yes, that's the more common pattern - normally the caller will need
*pmic for some other purpose anyway so it saves an additional regmap
lookup if that's desired.

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ