On Fri, Nov 12, 2010 at 10:02:00AM -0800, [email protected] wrote:
> From: Dirk Brandewie <[email protected]>
> 
> This patch adds a command line argument to allow the user to request
> the that the blob be padded out to modulo <bytes> size.

[snip]
> @@ -411,6 +412,20 @@ void dt_to_blob(FILE *f, struct boot_info *bi, int 
> version)
>       }
>  
>       /*
> +      * If the user asked for alignment of the end of the blob,
> +      * adjust the totalsize. 
> +      */
> +
> +     if (align_size > 0)
> +             align_len = align_size;
> +
> +     if (align_len > 0) {
> +             int tsize = fdt32_to_cpu(fdt.totalsize);
> +             tsize += alignlen;
> +             fdt.totalsize = cpu_to_fdt32(tsize);

Uh.. what?  You just added the alignment to totalsize, rather than
aligning totalsize to the alignment.

Also, rather than introducing a new variable, it would be simpler to
just adjust padlen based on the alignment.

-- 
David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!
http://www.ozlabs.org/~dgibson
_______________________________________________
devicetree-discuss mailing list
[email protected]
https://lists.ozlabs.org/listinfo/devicetree-discuss

Reply via email to