[U-Boot] [PATCH RESEND] Fix misuse of calloc() in linux/compat.h header

Wolfgang Denk wd at denx.de
Sat Jun 9 01:43:43 CEST 2012


Dear Marek Vasut,

In message <1339176514-13137-1-git-send-email-marex at denx.de> you wrote:
> 
> -#define kzalloc(size, flags)	calloc(size, 1)
> +#define kzalloc(size, flags)	calloc(1, size)

Does this make any practical difference?

I mean, are you aware of any problem that gets fixed by this patch, or
even any kind of performance degradation?

"common/dlmalloc.src" says:

	calloc(size_t unit, size_t quantity);
	   Returns a pointer to quantity * unit bytes, with all locations
	   set to zero.

Multiplication being commutative, I see zero effect in this patch?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Business is like a wheelbarrow. Nothing ever happens until you  start
pushing.


More information about the U-Boot mailing list