[PATCH v2] mkimage: fit_image: Make fit header and data align to 512

Tom Rini trini at konsulko.com
Mon Mar 16 14:29:43 CET 2020


On Mon, Mar 16, 2020 at 07:11:54PM +0900, Punit Agrawal wrote:
> Kever Yang <kever.yang at rock-chips.com> writes:
> 
> > On 2020/3/16 下午3:28, Punit Agrawal wrote:
> >> Kever Yang <kever.yang at rock-chips.com> writes:
> 
> [...]
> 
> >> Instead of adding another copy of this code (versions of it already
> >> exist in imx8mimage.c, ifwitool.c, aisiamge.c), it would be better to
> >> move the below snippet to imagetool.h.
> >>
> >> #define __ALIGN_MASK(x, mask)	(((x) + (mask)) & ~(mask))
> >> #define ALIGN(x, a)		__ALIGN_MASK((x), (typeof(x))(a) - 1)
> >>
> >> With this, you can drop the version in imx8mimage.c which seems to
> >> introduce an unnecessary multiplication / division.
> >
> >
> > The definition of ALIGN is already at include/linux/kernel.h, is it
> > better to use that directly?
> 
> If there are no restrictions to include that header, please use
> it. It'll be better than making another copy. :)

We can't use that header in tools/ user-space code, no.  Using
imagetool.h by the ARRAY_SIZE macro is a good spot.  Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200316/a6b115f3/attachment.sig>


More information about the U-Boot mailing list