Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347885
b: refs/heads/master
c: c4e1849
h: refs/heads/master
i:
  347883: eb40905
v: v3
  • Loading branch information
Guenter Roeck authored and Linus Torvalds committed Dec 21, 2012
1 parent a34a9d5 commit 979a7cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 154b454edaf6d94a69016db6c342c57fa935bbe9
refs/heads/master: c4e18497d8fd92eef2c6e7eadcc1a107ccd115ea
6 changes: 4 additions & 2 deletions trunk/include/linux/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,15 @@

/*
* Divide positive or negative dividend by positive divisor and round
* to closest integer. Result is undefined for negative divisors.
* to closest integer. Result is undefined for negative divisors and
* for negative dividends if the divisor variable type is unsigned.
*/
#define DIV_ROUND_CLOSEST(x, divisor)( \
{ \
typeof(x) __x = x; \
typeof(divisor) __d = divisor; \
(((typeof(x))-1) > 0 || (__x) > 0) ? \
(((typeof(x))-1) > 0 || \
((typeof(divisor))-1) > 0 || (__x) > 0) ? \
(((__x) + ((__d) / 2)) / (__d)) : \
(((__x) - ((__d) / 2)) / (__d)); \
} \
Expand Down

0 comments on commit 979a7cc

Please sign in to comment.