On Sat, Feb 20, 2016 at 01:32:20AM +0100, Patrick Wildt wrote:
> Hi,
>
> there seems to be a broken check in socppc's fdt code. I think this
> should not be a binary AND.
>
> I have no hardware to verify that diff.
>
> Patrick
>
> diff --git sys/arch/socppc/socppc/fdt.c sys/arch/socppc/socppc/fdt.c
> index 9dae7e2..7423988 100644
> --- sys/arch/socppc/socppc/fdt.c
> +++ sys/arch/socppc/socppc/fdt.c
> @@ -58,7 +58,7 @@ fdt_check_head(void *fdt)
> return 0;
>
> /* check for end signature on version 17 blob */
> - if ((fh->fh_version >= 17) & (*(ptr + fh->fh_struct_size) != FDT_END))
> + if ((fh->fh_version >= 17) && (*(ptr + fh->fh_struct_size) != FDT_END))
> return 0;
>
> return fh->fh_version;
Also I'm fairly certain this check is not correct. It stops my
not-socppc machine from booting up.
Something like
if ((fh->fh_version >= 17) && (*(ptr + (fh->fh_struct_size / 4)) !=
FDT_END))
might be better in theory, but still doesn't work on my machine.