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]
Date:	Wed, 29 Sep 2010 15:29:58 +0900
From:	Grant Likely <grant.likely@...retlab.ca>
To:	Michal Simek <monstr@...str.eu>
Cc:	linux-kernel@...r.kernel.org, john.williams@...alogix.com,
	edgar.iglesias@...il.com, duyl@...inx.com, linnj@...inx.com,
	microblaze-uclinux@...e.uq.edu.au,
	David Woodhouse <dwmw2@...radead.org>,
	Tejun Heo <tj@...nel.org>, linux-mtd@...ts.infradead.org,
	devicetree-discuss@...ts.ozlabs.org
Subject: Re: [PATCH 2/7] of: MTD: Fix OF probing on little-endian systems

On Wed, Sep 29, 2010 at 03:52:13PM +1000, Michal Simek wrote:
> Convert big-endian DTB to little-endian if necessary.
> 
> Signed-off-by: Michal Simek <monstr@...str.eu>
> CC: David Woodhouse <dwmw2@...radead.org>
> CC: Tejun Heo <tj@...nel.org>
> CC: Grant Likely <grant.likely@...retlab.ca>
> CC: linux-mtd@...ts.infradead.org
> CC: linux-kernel@...r.kernel.org
> CC: devicetree-discuss@...ts.ozlabs.org

Applied, thanks.

g.

> ---
>  drivers/mtd/maps/physmap_of.c |    2 +-
>  drivers/mtd/ofpart.c          |    4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
> index fe63f6b..ec3edf6 100644
> --- a/drivers/mtd/maps/physmap_of.c
> +++ b/drivers/mtd/maps/physmap_of.c
> @@ -294,7 +294,7 @@ static int __devinit of_flash_probe(struct platform_device *dev,
>  		info->list[i].map.name = dev_name(&dev->dev);
>  		info->list[i].map.phys = res.start;
>  		info->list[i].map.size = res_size;
> -		info->list[i].map.bankwidth = *width;
> +		info->list[i].map.bankwidth = be32_to_cpup(width);
>  
>  		err = -ENOMEM;
>  		info->list[i].map.virt = ioremap(info->list[i].map.phys,
> diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
> index 8bf7dc6..7bd171e 100644
> --- a/drivers/mtd/ofpart.c
> +++ b/drivers/mtd/ofpart.c
> @@ -53,8 +53,8 @@ int __devinit of_mtd_parse_partitions(struct device *dev,
>  			continue;
>  		}
>  
> -		(*pparts)[i].offset = reg[0];
> -		(*pparts)[i].size = reg[1];
> +		(*pparts)[i].offset = be32_to_cpu(reg[0]);
> +		(*pparts)[i].size = be32_to_cpu(reg[1]);
>  
>  		partname = of_get_property(pp, "label", &len);
>  		if (!partname)
> -- 
> 1.5.5.1
> 
--
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