diff options
-rw-r--r-- | arch/arm/mach-ep93xx/clock.c | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/vio.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/intel_cacheinfo.c | 1 | ||||
-rw-r--r-- | drivers/crypto/hifn_795x.c | 4 | ||||
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_main.c | 3 | ||||
-rw-r--r-- | drivers/macintosh/windfarm_pm121.c | 2 | ||||
-rw-r--r-- | drivers/video/au1200fb.c | 2 | ||||
-rw-r--r-- | mm/slab.c | 2 |
8 files changed, 9 insertions, 12 deletions
diff --git a/arch/arm/mach-ep93xx/clock.c b/arch/arm/mach-ep93xx/clock.c index 4566bd1c8660..ef06c66a6f16 100644 --- a/arch/arm/mach-ep93xx/clock.c +++ b/arch/arm/mach-ep93xx/clock.c | |||
@@ -358,8 +358,7 @@ static int calc_clk_div(struct clk *clk, unsigned long rate, | |||
358 | int i, found = 0, __div = 0, __pdiv = 0; | 358 | int i, found = 0, __div = 0, __pdiv = 0; |
359 | 359 | ||
360 | /* Don't exceed the maximum rate */ | 360 | /* Don't exceed the maximum rate */ |
361 | max_rate = max(max(clk_pll1.rate / 4, clk_pll2.rate / 4), | 361 | max_rate = max3(clk_pll1.rate / 4, clk_pll2.rate / 4, clk_xtali.rate / 4); |
362 | clk_xtali.rate / 4); | ||
363 | rate = min(rate, max_rate); | 362 | rate = min(rate, max_rate); |
364 | 363 | ||
365 | /* | 364 | /* |
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c index d692989a4318..441d2a722f06 100644 --- a/arch/powerpc/kernel/vio.c +++ b/arch/powerpc/kernel/vio.c | |||
@@ -238,9 +238,7 @@ static inline void vio_cmo_dealloc(struct vio_dev *viodev, size_t size) | |||
238 | * memory in this pool does not change. | 238 | * memory in this pool does not change. |
239 | */ | 239 | */ |
240 | if (spare_needed && reserve_freed) { | 240 | if (spare_needed && reserve_freed) { |
241 | tmp = min(spare_needed, min(reserve_freed, | 241 | tmp = min3(spare_needed, reserve_freed, (viodev->cmo.entitled - VIO_CMO_MIN_ENT)); |
242 | (viodev->cmo.entitled - | ||
243 | VIO_CMO_MIN_ENT))); | ||
244 | 242 | ||
245 | vio_cmo.spare += tmp; | 243 | vio_cmo.spare += tmp; |
246 | viodev->cmo.entitled -= tmp; | 244 | viodev->cmo.entitled -= tmp; |
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index 12cd823c8d03..17ad03366211 100644 --- a/arch/x86/kernel/cpu/intel_cacheinfo.c +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c | |||
@@ -327,6 +327,7 @@ static void __cpuinit amd_calc_l3_indices(struct amd_l3_cache *l3) | |||
327 | l3->subcaches[3] = sc3 = !(val & BIT(12)) + !(val & BIT(13)); | 327 | l3->subcaches[3] = sc3 = !(val & BIT(12)) + !(val & BIT(13)); |
328 | 328 | ||
329 | l3->indices = (max(max(max(sc0, sc1), sc2), sc3) << 10) - 1; | 329 | l3->indices = (max(max(max(sc0, sc1), sc2), sc3) << 10) - 1; |
330 | l3->indices = (max(max3(sc0, sc1, sc2), sc3) << 10) - 1; | ||
330 | } | 331 | } |
331 | 332 | ||
332 | static struct amd_l3_cache * __cpuinit amd_init_l3_cache(int node) | 333 | static struct amd_l3_cache * __cpuinit amd_init_l3_cache(int node) |
diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c index 0eac3da566ba..a84250a5dd51 100644 --- a/drivers/crypto/hifn_795x.c +++ b/drivers/crypto/hifn_795x.c | |||
@@ -1467,7 +1467,7 @@ static int ablkcipher_add(unsigned int *drestp, struct scatterlist *dst, | |||
1467 | return -EINVAL; | 1467 | return -EINVAL; |
1468 | 1468 | ||
1469 | while (size) { | 1469 | while (size) { |
1470 | copy = min(drest, min(size, dst->length)); | 1470 | copy = min3(drest, size, dst->length); |
1471 | 1471 | ||
1472 | size -= copy; | 1472 | size -= copy; |
1473 | drest -= copy; | 1473 | drest -= copy; |
@@ -1729,7 +1729,7 @@ static int ablkcipher_get(void *saddr, unsigned int *srestp, unsigned int offset | |||
1729 | return -EINVAL; | 1729 | return -EINVAL; |
1730 | 1730 | ||
1731 | while (size) { | 1731 | while (size) { |
1732 | copy = min(srest, min(dst->length, size)); | 1732 | copy = min3(srest, dst->length, size); |
1733 | 1733 | ||
1734 | daddr = kmap_atomic(sg_page(dst), KM_IRQ0); | 1734 | daddr = kmap_atomic(sg_page(dst), KM_IRQ0); |
1735 | memcpy(daddr + dst->offset + offset, saddr, copy); | 1735 | memcpy(daddr + dst->offset + offset, saddr, copy); |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index b4b22576f12a..19c5d3b191f4 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
@@ -1409,8 +1409,7 @@ static int __init ipoib_init_module(void) | |||
1409 | 1409 | ||
1410 | ipoib_sendq_size = roundup_pow_of_two(ipoib_sendq_size); | 1410 | ipoib_sendq_size = roundup_pow_of_two(ipoib_sendq_size); |
1411 | ipoib_sendq_size = min(ipoib_sendq_size, IPOIB_MAX_QUEUE_SIZE); | 1411 | ipoib_sendq_size = min(ipoib_sendq_size, IPOIB_MAX_QUEUE_SIZE); |
1412 | ipoib_sendq_size = max(ipoib_sendq_size, max(2 * MAX_SEND_CQE, | 1412 | ipoib_sendq_size = max3(ipoib_sendq_size, 2 * MAX_SEND_CQE, IPOIB_MIN_QUEUE_SIZE); |
1413 | IPOIB_MIN_QUEUE_SIZE)); | ||
1414 | #ifdef CONFIG_INFINIBAND_IPOIB_CM | 1413 | #ifdef CONFIG_INFINIBAND_IPOIB_CM |
1415 | ipoib_max_conn_qp = min(ipoib_max_conn_qp, IPOIB_CM_MAX_CONN_QP); | 1414 | ipoib_max_conn_qp = min(ipoib_max_conn_qp, IPOIB_CM_MAX_CONN_QP); |
1416 | #endif | 1415 | #endif |
diff --git a/drivers/macintosh/windfarm_pm121.c b/drivers/macintosh/windfarm_pm121.c index 947d4afa25ca..30e6195e19d4 100644 --- a/drivers/macintosh/windfarm_pm121.c +++ b/drivers/macintosh/windfarm_pm121.c | |||
@@ -482,7 +482,7 @@ static s32 pm121_correct(s32 new_setpoint, | |||
482 | new_min += correction->offset; | 482 | new_min += correction->offset; |
483 | new_min = (new_min >> 16) + min; | 483 | new_min = (new_min >> 16) + min; |
484 | 484 | ||
485 | return max(new_setpoint, max(new_min, 0)); | 485 | return max3(new_setpoint, new_min, 0); |
486 | } | 486 | } |
487 | 487 | ||
488 | static s32 pm121_connect(unsigned int control_id, s32 setpoint) | 488 | static s32 pm121_connect(unsigned int control_id, s32 setpoint) |
diff --git a/drivers/video/au1200fb.c b/drivers/video/au1200fb.c index e77e8e4280fb..4ea187d93768 100644 --- a/drivers/video/au1200fb.c +++ b/drivers/video/au1200fb.c | |||
@@ -1079,7 +1079,7 @@ static int au1200fb_fb_check_var(struct fb_var_screeninfo *var, | |||
1079 | * clock can only be obtain by dividing this value by an even integer. | 1079 | * clock can only be obtain by dividing this value by an even integer. |
1080 | * Fallback to a slower pixel clock if necessary. */ | 1080 | * Fallback to a slower pixel clock if necessary. */ |
1081 | pixclock = max((u32)(PICOS2KHZ(var->pixclock) * 1000), fbi->monspecs.dclkmin); | 1081 | pixclock = max((u32)(PICOS2KHZ(var->pixclock) * 1000), fbi->monspecs.dclkmin); |
1082 | pixclock = min(pixclock, min(fbi->monspecs.dclkmax, (u32)AU1200_LCD_MAX_CLK/2)); | 1082 | pixclock = min3(pixclock, fbi->monspecs.dclkmax, (u32)AU1200_LCD_MAX_CLK/2); |
1083 | 1083 | ||
1084 | if (AU1200_LCD_MAX_CLK % pixclock) { | 1084 | if (AU1200_LCD_MAX_CLK % pixclock) { |
1085 | int diff = AU1200_LCD_MAX_CLK % pixclock; | 1085 | int diff = AU1200_LCD_MAX_CLK % pixclock; |
@@ -901,7 +901,7 @@ static int transfer_objects(struct array_cache *to, | |||
901 | struct array_cache *from, unsigned int max) | 901 | struct array_cache *from, unsigned int max) |
902 | { | 902 | { |
903 | /* Figure out how many entries to transfer */ | 903 | /* Figure out how many entries to transfer */ |
904 | int nr = min(min(from->avail, max), to->limit - to->avail); | 904 | int nr = min3(from->avail, max, to->limit - to->avail); |
905 | 905 | ||
906 | if (!nr) | 906 | if (!nr) |
907 | return 0; | 907 | return 0; |