On Mon, Apr 25, 2016 at 3:17 PM, Beniamino Galvani <b.galv...@gmail.com> wrote: > On Mon, Apr 25, 2016 at 01:01:10PM -0500, Joe Hershberger wrote: >> > - desc_p->dmamac_addr = &txbuffs[idx * CONFIG_ETH_BUFSIZE]; >> > - desc_p->dmamac_next = &desc_table_p[idx + 1]; >> > + desc_p->dmamac_addr = (ulong)&txbuffs[idx * >> > CONFIG_ETH_BUFSIZE]; >> > + desc_p->dmamac_next = (ulong)&desc_table_p[idx + 1]; >> >> Why are you not casting to the type of the struct member (u32)? Won't >> this emit warnings on 64-bit? > > Hi, > > casting to u32 would cause a warning on arm64 ("warning: cast from > pointer to integer of different size [-Wpointer-to-int-cast]") because > the pointer is 64bit. > > The (ulong) cast is needed to convert the pointer to an arithmetic > type of same width, which then can be assigned to the struct > member. The assignment operator implicitly converts between different > arithmetic types without the need for explicit casts.
That's the part that surprises me. I thought arithmetic assignments from larger to smaller types would warn. Anyway, if it's warning clean, Acked-by: Joe Hershberger <joe.hershber...@ni.com> _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot