nvidia-agp: use time_before_eq()
diff mbox series

Message ID 20051130213902.GB12551@mipter.zuzino.mipt.ru
State New, archived
Headers show
Series
  • nvidia-agp: use time_before_eq()
Related show

Commit Message

Alexey Dobriyan Nov. 30, 2005, 9:39 p.m. UTC
From: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>

It deals with wrapping correctly and is nicer to read.

Signed-off-by: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 drivers/char/agp/nvidia-agp.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Comments

Tim Schmielau Nov. 30, 2005, 10:50 p.m. UTC | #1
On Thu, 1 Dec 2005, Alexey Dobriyan wrote:

> It deals with wrapping correctly and is nicer to read.

> -			if ((signed)(end - jiffies) <= 0) {
> +			if (time_before_eq(end, jiffies)) {

It'd be even nicer to read if it were
			if (time_after_eq(jiffies, end)) {
like the other users of these macros.

Tim
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Patch
diff mbox series

--- a/drivers/char/agp/nvidia-agp.c
+++ b/drivers/char/agp/nvidia-agp.c
@@ -11,6 +11,7 @@ 
 #include <linux/gfp.h>
 #include <linux/page-flags.h>
 #include <linux/mm.h>
+#include <linux/jiffies.h>
 #include "agp.h"
 
 /* NVIDIA registers */
@@ -256,7 +257,7 @@  static void nvidia_tlbflush(struct agp_m
 		do {
 			pci_read_config_dword(nvidia_private.dev_1,
 					NVIDIA_1_WBC, &wbc_reg);
-			if ((signed)(end - jiffies) <= 0) {
+			if (time_before_eq(end, jiffies)) {
 				printk(KERN_ERR PFX
 				    "TLB flush took more than 3 seconds.\n");
 			}