Re: [PATCH] Misuse of sizeof

From: Gregory Petrosyan
Date: Sat Dec 13 2008 - 11:56:31 EST


On Sat, Dec 13, 2008 at 05:31:06PM +0100, Giangiacomo Mariotti wrote:
> IMO there's a bug in the use of sizeof in /arch/x86/boot/main.c, it's
> also a strange style.

> - BUILD_BUG_ON(sizeof boot_params != 4096);
> - memcpy(&boot_params.hdr, &hdr, sizeof hdr);
> + BUILD_BUG_ON(sizeof(boot_params) != 4096);
> + memcpy(&boot_params.hdr, &hdr, sizeof(hdr));

The 'sizeof xxx' style is perfectly valid.

Gregory
--
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/