Skip to content

Commit

Permalink
overflow: Include header file with SIZE_MAX declaration
Browse files Browse the repository at this point in the history
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/20200913102928.134985-1-leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
  • Loading branch information
Leon Romanovsky authored and Jason Gunthorpe committed Oct 2, 2020
1 parent f45271a commit a4947e8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions include/linux/overflow.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#define __LINUX_OVERFLOW_H

#include <linux/compiler.h>
#include <linux/limits.h>

/*
* In the fallback code below, we need to compute the minimum and
Expand Down

0 comments on commit a4947e8

Please sign in to comment.