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: <201502271656.09698@pali>
Date:	Fri, 27 Feb 2015 16:56:09 +0100
From:	Pali Rohár <pali.rohar@...il.com>
To:	Andreas Färber <afaerber@...e.de>
Cc:	Rob Herring <robherring2@...il.com>,
	Ivaylo Dimitrov <ivo.g.dimitrov.75@...il.com>,
	Russell King <linux@....linux.org.uk>,
	Tony Lindgren <tony@...mide.com>,
	Sebastian Reichel <sre@...ian.org>,
	Will Deacon <will.deacon@....com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Pavel Machek <pavel@....cz>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH] ARM: /proc/cpuinfo: DT: Add support for Revision

On Monday 26 January 2015 23:34:34 Andreas Färber wrote:
> Am 26.01.2015 um 20:09 schrieb Pali Rohár:
> > diff --git a/arch/arm/kernel/devtree.c
> > b/arch/arm/kernel/devtree.c index 11c54de..9946c1b 100644
> > --- a/arch/arm/kernel/devtree.c
> > +++ b/arch/arm/kernel/devtree.c
> 
> [...]
> 
> > @@ -204,6 +206,8 @@ static const void * __init
> > arch_get_next_mach(const char *const **match)
> > 
> >  const struct machine_desc * __init
> >  setup_machine_fdt(unsigned int dt_phys) {
> >  
> >  	const struct machine_desc *mdesc, *mdesc_best = NULL;
> > 
> > +	unsigned long dt_root;
> > +	const u32 *prop;
> > 
> >  #ifdef CONFIG_ARCH_MULTIPLATFORM
> >  
> >  	DT_MACHINE_START(GENERIC_DT, "Generic DT based system")
> > 
> > @@ -215,17 +219,16 @@ const struct machine_desc * __init
> > setup_machine_fdt(unsigned int dt_phys)
> > 
> >  	if (!dt_phys ||
> >  	!early_init_dt_verify(phys_to_virt(dt_phys)))
> >  	
> >  		return NULL;
> > 
> > +	dt_root = of_get_flat_dt_root();
> > 
> >  	mdesc = of_flat_dt_match_machine(mdesc_best,
> >  	arch_get_next_mach);
> >  	
> >  	if (!mdesc) {
> >  	
> >  		const char *prop;
> 
> Probably the use of two differently typed variables of name
> "prop" in this function is not intentional?
> 

Fixed in PATCH v2.

> Regards,
> Andreas
> 
> >  		int size;
> > 
> > -		unsigned long dt_root;
> > 
> >  		early_print("\nError: unrecognized/unsupported "
> >  		
> >  			    "device tree compatible list:\n[ ");
> > 
> > -		dt_root = of_get_flat_dt_root();
> > 
> >  		prop = of_get_flat_dt_prop(dt_root, "compatible", 
&size);
> >  		while (size > 0) {
> >  		
> >  			early_print("'%s' ", prop);
> > 
> > @@ -246,5 +249,10 @@ const struct machine_desc * __init
> > setup_machine_fdt(unsigned int dt_phys)
> > 
> >  	/* Change machine number to match the mdesc we're using */
> >  	__machine_arch_type = mdesc->nr;
> > 
> > +	/* Set system revision from DT */
> > +	prop = of_get_flat_dt_prop(dt_root, "revision", NULL);
> > +	if (prop)
> > +		system_rev = fdt32_to_cpu(*prop);
> > +
> > 
> >  	return mdesc;
> >  
> >  }
> 
> [snip]

-- 
Pali Rohár
pali.rohar@...il.com

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ