]> pilppa.com Git - linux-2.6-omap-h63xx.git/commit
[PATCH] kcalloc(): INT_MAX -> ULONG_MAX
authorAdrian Bunk <bunk@stusta.de>
Wed, 22 Mar 2006 08:08:09 +0000 (00:08 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 22 Mar 2006 15:53:58 +0000 (07:53 -0800)
commitb50ec7d8070ae7a39fe78e65a8812bbc3ca2f7ac
tree56a30fe319a1c4356547d13896d6762df76980d7
parenta482289d46587ffcda4c85aab109fb74910d7a48
[PATCH] kcalloc(): INT_MAX -> ULONG_MAX

Since size_t has the same size as a long on all architectures, it's enough
for overflow checks to check against ULONG_MAX.

This change could allow a compiler better optimization (especially in the
n=1 case).

The practical effect seems to be positive, but quite small:

    text           data     bss      dec            hex filename
21762380        5859870 1848928 29471178        1c1b1ca vmlinux-old
21762211        5859870 1848928 29471009        1c1b121 vmlinux-patched

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/slab.h