diff options
| -rw-r--r-- | drivers/atm/horizon.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/atm/horizon.c b/drivers/atm/horizon.c index 6b969f8c684f..01ce241dbeae 100644 --- a/drivers/atm/horizon.c +++ b/drivers/atm/horizon.c | |||
| @@ -641,7 +641,7 @@ static int make_rate (const hrz_dev * dev, u32 c, rounding r, | |||
| 641 | pre = 1; | 641 | pre = 1; |
| 642 | break; | 642 | break; |
| 643 | case round_nearest: | 643 | case round_nearest: |
| 644 | pre = (br+(c<<div)/2)/(c<<div); | 644 | pre = DIV_ROUND_CLOSEST(br, c<<div); |
| 645 | // but p must be non-zero | 645 | // but p must be non-zero |
| 646 | if (!pre) | 646 | if (!pre) |
| 647 | pre = 1; | 647 | pre = 1; |
| @@ -671,7 +671,7 @@ static int make_rate (const hrz_dev * dev, u32 c, rounding r, | |||
| 671 | pre = DIV_ROUND_UP(br, c<<div); | 671 | pre = DIV_ROUND_UP(br, c<<div); |
| 672 | break; | 672 | break; |
| 673 | case round_nearest: | 673 | case round_nearest: |
| 674 | pre = (br+(c<<div)/2)/(c<<div); | 674 | pre = DIV_ROUND_CLOSEST(br, c<<div); |
| 675 | break; | 675 | break; |
| 676 | default: /* round_up */ | 676 | default: /* round_up */ |
| 677 | pre = br/(c<<div); | 677 | pre = br/(c<<div); |
