Commit d0160ff8 authored by Viktor Rosendahl's avatar Viktor Rosendahl Committed by Tony Lindgren

lowmem: remove an unecessary local variable

This "changed" variable is kind of deprecated. We used to have a spinlock
[which was later deemed unecessary] around the first if clause in the
*_watermark_state() functions; the variable was needed in order to move the
operation in the second if clause out of the lock section.
Signed-off-by: default avatarViktor Rosendahl <viktor.rosendahl@nokia.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 7ad66bbe
...@@ -136,28 +136,18 @@ KERNEL_ATTR_RO(high_watermark); ...@@ -136,28 +136,18 @@ KERNEL_ATTR_RO(high_watermark);
static void low_watermark_state(int new_state) static void low_watermark_state(int new_state)
{ {
int changed = 0;
if (low_watermark_reached != new_state) { if (low_watermark_reached != new_state) {
low_watermark_reached = new_state; low_watermark_reached = new_state;
changed = 1;
}
if (changed)
sysfs_notify(&kernel_subsys.kset.kobj, NULL, "low_watermark"); sysfs_notify(&kernel_subsys.kset.kobj, NULL, "low_watermark");
}
} }
static void high_watermark_state(int new_state) static void high_watermark_state(int new_state)
{ {
int changed = 0;
if (high_watermark_reached != new_state) { if (high_watermark_reached != new_state) {
high_watermark_reached = new_state; high_watermark_reached = new_state;
changed = 1;
}
if (changed)
sysfs_notify(&kernel_subsys.kset.kobj, NULL, "high_watermark"); sysfs_notify(&kernel_subsys.kset.kobj, NULL, "high_watermark");
}
} }
static int low_vm_enough_memory(long pages) static int low_vm_enough_memory(long pages)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment