Skip to content

Commit a4947e8

Browse files
rleonjgunthorpe
authored andcommitted
overflow: Include header file with SIZE_MAX declaration
The various array_size functions use SIZE_MAX define, but missed limits.h causes to failure to compile code that needs overflow.h. In file included from drivers/infiniband/core/uverbs_std_types_device.c:6: ./include/linux/overflow.h: In function 'array_size': ./include/linux/overflow.h:258:10: error: 'SIZE_MAX' undeclared (first use in this function) 258 | return SIZE_MAX; | ^~~~~~~~ Fixes: 610b15c ("overflow.h: Add allocation size calculation helpers") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent f45271a commit a4947e8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

include/linux/overflow.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#define __LINUX_OVERFLOW_H
44

55
#include <linux/compiler.h>
6+
#include <linux/limits.h>
67

78
/*
89
* In the fallback code below, we need to compute the minimum and

0 commit comments

Comments
 (0)