]> git.karo-electronics.de Git - karo-tx-linux.git/commit
introduce SIZE_MAX
authorXi Wang <xi.wang@gmail.com>
Thu, 3 May 2012 05:44:13 +0000 (15:44 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 3 May 2012 05:46:42 +0000 (15:46 +1000)
commit3232ba962ce31470feb5a1dd749b5c86b26d008b
tree4c7791c1e74533f8e01636cad2ebd40542c2ca54
parentd3fcb23b9042e27a9bd506964187eed745ce7dae
introduce SIZE_MAX

ULONG_MAX is often used to check for integer overflow when calculating
allocation size.  While ULONG_MAX happens to work on most systems, there
is no guarantee that `size_t' must be the same size as `long'.

This patch introduces SIZE_MAX, the maximum value of `size_t', to improve
portability and readability for allocation size validation.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Acked-by: Alex Elder <elder@dreamhost.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/ceph/snap.c
include/drm/drm_mem_util.h
include/linux/kernel.h
include/linux/slab.h