2003-02-12 23:06:56

by Stephen Hemminger

[permalink] [raw]
Subject: [PATCH] Eliminate compile warnings from min() in mm

The following gets rid of the warnings:

mm/vmscan.c: In function `shrink_caches':
mm/vmscan.c:768: warning: duplicate `const'
mm/swap_state.c: In function `free_pages_and_swap_cache':
mm/swap_state.c:302: warning: duplicate `const'



diff -Nru a/mm/swap_state.c b/mm/swap_state.c
--- a/mm/swap_state.c Wed Feb 12 14:20:26 2003
+++ b/mm/swap_state.c Wed Feb 12 14:20:26 2003
@@ -294,7 +294,7 @@
*/
void free_pages_and_swap_cache(struct page **pages, int nr)
{
- const int chunk = 16;
+ int chunk = 16;
struct page **pagep = pages;

lru_add_drain();
diff -Nru a/mm/vmscan.c b/mm/vmscan.c
--- a/mm/vmscan.c Wed Feb 12 14:20:26 2003
+++ b/mm/vmscan.c Wed Feb 12 14:20:26 2003
@@ -765,7 +765,7 @@

first_classzone = classzone->zone_pgdat->node_zones;
for (zone = classzone; zone >= first_classzone; zone--) {
- int to_reclaim = max(nr_pages, SWAP_CLUSTER_MAX);
+ int to_reclaim = max_t(int, nr_pages, SWAP_CLUSTER_MAX);
int nr_mapped = 0;
int max_scan;