Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 780a0656 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds
Browse files

[PATCH] count_vm_events-warning-fix



- Prevent things like this:

	block/ll_rw_blk.c: In function 'submit_bio':
	block/ll_rw_blk.c:3222: warning: unused variable 'count'

  inlines are very, very preferable to macros.

- remove unused get_cpu_vm_events() macro

Cc: Christoph Lameter <clameter@engr.sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 7131b6d1
Loading
Loading
Loading
Loading
+29 −18
Original line number Original line Diff line number Diff line
@@ -7,18 +7,6 @@
#include <linux/mmzone.h>
#include <linux/mmzone.h>
#include <asm/atomic.h>
#include <asm/atomic.h>


#ifdef CONFIG_VM_EVENT_COUNTERS
/*
 * Light weight per cpu counter implementation.
 *
 * Counters should only be incremented.  You need to set EMBEDDED
 * to disable VM_EVENT_COUNTERS.  Things like procps (vmstat,
 * top, etc) use /proc/vmstat and depend on these counters.
 *
 * Counters are handled completely inline. On many platforms the code
 * generated will simply be the increment of a global address.
 */

#ifdef CONFIG_ZONE_DMA
#ifdef CONFIG_ZONE_DMA
#define DMA_ZONE(xx) xx##_DMA,
#define DMA_ZONE(xx) xx##_DMA,
#else
#else
@@ -52,6 +40,17 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
		NR_VM_EVENT_ITEMS
		NR_VM_EVENT_ITEMS
};
};


#ifdef CONFIG_VM_EVENT_COUNTERS
/*
 * Light weight per cpu counter implementation.
 *
 * Counters should only be incremented and no critical kernel component
 * should rely on the counter values.
 *
 * Counters are handled completely inline. On many platforms the code
 * generated will simply be the increment of a global address.
 */

struct vm_event_state {
struct vm_event_state {
	unsigned long event[NR_VM_EVENT_ITEMS];
	unsigned long event[NR_VM_EVENT_ITEMS];
};
};
@@ -92,12 +91,24 @@ static inline void vm_events_fold_cpu(int cpu)
#else
#else


/* Disable counters */
/* Disable counters */
#define get_cpu_vm_events(e)	0L
static inline void count_vm_event(enum vm_event_item item)
#define count_vm_event(e)	do { } while (0)
{
#define count_vm_events(e,d)	do { } while (0)
}
#define __count_vm_event(e)	do { } while (0)
static inline void count_vm_events(enum vm_event_item item, long delta)
#define __count_vm_events(e,d)	do { } while (0)
{
#define vm_events_fold_cpu(x)	do { } while (0)
}
static inline void __count_vm_event(enum vm_event_item item)
{
}
static inline void __count_vm_events(enum vm_event_item item, long delta)
{
}
static inline void all_vm_events(unsigned long *ret)
{
}
static inline void vm_events_fold_cpu(int cpu)
{
}


#endif /* CONFIG_VM_EVENT_COUNTERS */
#endif /* CONFIG_VM_EVENT_COUNTERS */