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: <20120507154826.GB10222@core.coreip.homeip.net>
Date:	Mon, 7 May 2012 08:48:26 -0700
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	Peter Ujfalusi <peter.ujfalusi@...com>
Cc:	linux-kernel@...r.kernel.org, linux-input@...r.kernel.org,
	Misael Lopez Cruz <misael.lopez@...com>,
	Benoit Cousson <b-cousson@...com>,
	devicetree-discuss@...ts.ozlabs.org, Liam Girdwood <lrg@...com>
Subject: Re: [PATCH] Input: tl6040-vibra: Device Tree support

On Mon, May 07, 2012 at 01:49:29PM +0300, Peter Ujfalusi wrote:
> Hi Dmitry,
> 
> On 05/07/2012 10:02 AM, Dmitry Torokhov wrote:
> > Hi Peter,
> > 
> > On Fri, May 04, 2012 at 03:05:13PM +0300, Peter Ujfalusi wrote:
> >> +	if (pdata) {
> >> +		info->vibldrv_res = pdata->vibldrv_res;
> >> +		info->vibrdrv_res = pdata->vibrdrv_res;
> >> +		info->viblmotor_res = pdata->viblmotor_res;
> >> +		info->vibrmotor_res = pdata->vibrmotor_res;
> >> +		vddvibl_uV = pdata->vddvibl_uV;
> >> +		vddvibr_uV = pdata->vddvibr_uV;
> >> +	} else {
> >> +		of_property_read_u32(node, "vibldrv_res", &info->vibldrv_res);
> >> +		of_property_read_u32(node, "vibrdrv_res", &info->vibrdrv_res);
> >> +		of_property_read_u32(node, "viblmotor_res",
> >> +				     &info->viblmotor_res);
> >> +		of_property_read_u32(node, "vibrmotor_res",
> >> +				     &info->vibrmotor_res);
> > 
> > Since these 4 appear to be mandatory properties don't we need to
> > validate they are actually present in DT?
> 
> If the property does not exist in the DT blob the variable will not be
> updated - it will remain 0.
> I have kept the validity check for the resistance values. This will
> catch the case when something is missing from the DT blob.
> 
> I just did not wanted to complicate the code with additional checks
> since the end result would be the same.

Ah, indeed, I missed that we still validate the values.

Applied, thanks Peter.

-- 
Dmitry
--
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