aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/ia32/ia32_aout.c
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2008-01-30 07:32:17 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:32:17 -0500
commite5fc3161969b3c82c8c61af8c8d360e39977ae2e (patch)
tree5a95c7411ea337324fa1880cbf04e7d10a430b40 /arch/x86/ia32/ia32_aout.c
parent31f80e45ea26008939790b4363a4fdcff240e0d6 (diff)
arch/x86/ia32: use time_before, time_before_eq, etc.
The functions time_before, time_before_eq, time_after, and time_after_eq are more robust for comparing jiffies against other values. A simplified version of the semantic patch making this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @ change_compare_np @ expression E; @@ ( - jiffies <= E + time_before_eq(jiffies,E) | - jiffies >= E + time_after_eq(jiffies,E) | - jiffies < E + time_before(jiffies,E) | - jiffies > E + time_after(jiffies,E) ) @ include depends on change_compare_np @ @@ #include <linux/jiffies.h> @ no_include depends on !include && change_compare_np @ @@ #include <linux/...> + #include <linux/jiffies.h> // </smpl> [ mingo@elte.hu: merge to x86.git ] Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/ia32/ia32_aout.c')
-rw-r--r--arch/x86/ia32/ia32_aout.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/x86/ia32/ia32_aout.c b/arch/x86/ia32/ia32_aout.c
index f1a0f83676dc..e4c12079171b 100644
--- a/arch/x86/ia32/ia32_aout.c
+++ b/arch/x86/ia32/ia32_aout.c
@@ -25,6 +25,7 @@
25#include <linux/binfmts.h> 25#include <linux/binfmts.h>
26#include <linux/personality.h> 26#include <linux/personality.h>
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/jiffies.h>
28 29
29#include <asm/system.h> 30#include <asm/system.h>
30#include <asm/uaccess.h> 31#include <asm/uaccess.h>
@@ -359,13 +360,14 @@ static int load_aout_binary(struct linux_binprm *bprm, struct pt_regs *regs)
359#ifdef WARN_OLD 360#ifdef WARN_OLD
360 static unsigned long error_time, error_time2; 361 static unsigned long error_time, error_time2;
361 if ((ex.a_text & 0xfff || ex.a_data & 0xfff) && 362 if ((ex.a_text & 0xfff || ex.a_data & 0xfff) &&
362 (N_MAGIC(ex) != NMAGIC) && (jiffies-error_time2) > 5*HZ) { 363 (N_MAGIC(ex) != NMAGIC) &&
364 time_after(jiffies, error_time2 + 5*HZ)) {
363 printk(KERN_NOTICE "executable not page aligned\n"); 365 printk(KERN_NOTICE "executable not page aligned\n");
364 error_time2 = jiffies; 366 error_time2 = jiffies;
365 } 367 }
366 368
367 if ((fd_offset & ~PAGE_MASK) != 0 && 369 if ((fd_offset & ~PAGE_MASK) != 0 &&
368 (jiffies - error_time) > 5*HZ) { 370 time_after(jiffies, error_time + 5*HZ)) {
369 printk(KERN_WARNING 371 printk(KERN_WARNING
370 "fd_offset is not page aligned. Please convert " 372 "fd_offset is not page aligned. Please convert "
371 "program: %s\n", 373 "program: %s\n",
@@ -484,7 +486,7 @@ static int load_aout_library(struct file *file)
484 486
485#ifdef WARN_OLD 487#ifdef WARN_OLD
486 static unsigned long error_time; 488 static unsigned long error_time;
487 if ((jiffies-error_time) > 5*HZ) { 489 if (time_after(jiffies, error_time + 5*HZ)) {
488 printk(KERN_WARNING 490 printk(KERN_WARNING
489 "N_TXTOFF is not page aligned. Please convert " 491 "N_TXTOFF is not page aligned. Please convert "
490 "library: %s\n", 492 "library: %s\n",