forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Commit 98e1385 ("include/linux/radix-tree.h: replace kernel.h with the necessary inclusions") broke the radix tree test suite in two different ways; first by including math.h which didn't exist in the tools directory, and second by removing an implicit include of spinlock.h before lockdep.h. Fix both issues. Cc: Andy Shevchenko <[email protected]> Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Acked-by: Andy Shevchenko <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information
Showing
3 changed files
with
29 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#ifndef _TOOLS_MATH_H | ||
#define _TOOLS_MATH_H | ||
|
||
/* | ||
* This looks more complex than it should be. But we need to | ||
* get the type for the ~ right in round_down (it needs to be | ||
* as wide as the result!), and we want to evaluate the macro | ||
* arguments just once each. | ||
*/ | ||
#define __round_mask(x, y) ((__typeof__(x))((y)-1)) | ||
#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1) | ||
#define round_down(x, y) ((x) & ~__round_mask(x, y)) | ||
|
||
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) | ||
|
||
#ifndef roundup | ||
#define roundup(x, y) ( \ | ||
{ \ | ||
const typeof(y) __y = y; \ | ||
(((x) + (__y - 1)) / __y) * __y; \ | ||
} \ | ||
) | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters