Re: [PATCHv2] driver core/platform: don't leak memory allocated fordma_mask

From: Greg Kroah-Hartman
Date: Tue Jan 14 2014 - 13:03:07 EST


On Tue, Jan 14, 2014 at 11:36:48AM +0100, Uwe Kleine-König wrote:
> > I will try to get some figure on the number of platform_device
> > registered with a dmamask versus without a dmamask: adding the u64 to
> > all platform_object might cost more memory than the extra code (1 branch
> > and a function).
> Also take into account
>
> sizeof(struct platform_object) + strlen(average device)
>
> Before and after the change. ISTR that the first summand is ~300 (on
> ARM). With putting dma_mask unconditionally into platform_object this
> goes up by 8, IMHO that is OK.
>
> In return you save that alignment hassle and both your patch and the
> resulting code become simpler.

Yes, please do it this way, it makes it more obvious as to exactly what
is going on, which is more valuable than trying to be "tricky" and save
a few bytes of ram or rom.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/