[PATCH 04/10] lowmem: remove an unecessary local variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: Viktor Rosendahl <viktor.rosendahl@xxxxxxxxx>
---
 security/lowmem.c |   14 ++------------
 1 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/security/lowmem.c b/security/lowmem.c
index 2dc0c4a..183c57f 100644
--- a/security/lowmem.c
+++ b/security/lowmem.c
@@ -136,28 +136,18 @@ KERNEL_ATTR_RO(high_watermark);
 
 static void low_watermark_state(int new_state)
 {
-	int changed = 0;
-
 	if (low_watermark_reached != new_state) {
 		low_watermark_reached = new_state;
-		changed = 1;
-	}
-
-	if (changed)
 		sysfs_notify(&kernel_subsys.kset.kobj, NULL, "low_watermark");
+	}
 }
 
 static void high_watermark_state(int new_state)
 {
-	int changed = 0;
-
 	if (high_watermark_reached != new_state) {
 		high_watermark_reached = new_state;
-		changed = 1;
-	}
-
-	if (changed)
 		sysfs_notify(&kernel_subsys.kset.kobj, NULL, "high_watermark");
+	}
 }
 
 static int low_vm_enough_memory(long pages)
-- 
1.5.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux