Skip to content

Commit

Permalink
Fix ZERO_OR_NULL_PTR(ZERO_SIZE_PTR)
Browse files Browse the repository at this point in the history
The comparison with ZERO_SIZE_PTR in ZERO_OR_NULL_PTR() needs to be <=
(not just <) so that ZERO_OR_NULL_PTR(ZERO_SIZE_PTR) is 1.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
[ Duh!  - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Roland Dreier authored and Linus Torvalds committed Jul 20, 2007
1 parent efa7e86 commit 1d4ec7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/slab.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*/
#define ZERO_SIZE_PTR ((void *)16)

#define ZERO_OR_NULL_PTR(x) ((unsigned long)(x) < \
#define ZERO_OR_NULL_PTR(x) ((unsigned long)(x) <= \
(unsigned long)ZERO_SIZE_PTR)

/*
Expand Down

0 comments on commit 1d4ec7b

Please sign in to comment.