Skip to contentSkip to conversation

Cleanup namespace collision with ktimers in drivers/scsi/*53c8xx.*

PATCH In review [email protected] 3 participants 3 messages Oct 25, 2005 – Oct 27, 2005 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Cleanup namespace collision with ktimers in drivers/scsi/*53c8xx.*

From: Thomas Gleixner <[email protected]>

Rename the time related macros in *53c8xx.* to cleanup the namespace collision introduced by the ktimers patch.

---

 drivers/scsi/ncr53c8xx.c      |   22 +++++++++++-----------
 drivers/scsi/sym53c8xx_defs.h |   10 +++++-----
 2 files changed, 16 insertions(+), 16 deletions(-)
drivers/scsi/ncr53c8xx.c renamed from drivers/scsi/ncr53c8xx.c~cleanup-namespace-collision-with-ktimers-in +11 -11
diff -puN drivers/scsi/ncr53c8xx.c~cleanup-namespace-collision-with-ktimers-in drivers/scsi/ncr53c8xx.c
@@ -3481,8 +3481,8 @@ static int ncr_queue_command (struct ncb
 	**----------------------------------------------------
 	*/
 	if (np->settle_time && cmd->timeout_per_command >= HZ) {
-		u_long tlimit = ktime_get(cmd->timeout_per_command - HZ);
-		if (ktime_dif(np->settle_time, tlimit) > 0)
+		u_long tlimit = Ktime_get(cmd->timeout_per_command - HZ);
+		if (Ktime_dif(np->settle_time, tlimit) > 0)
 			np->settle_time = tlimit;
 	}
 
@@ -3516,7 +3516,7 @@ static int ncr_queue_command (struct ncb
 		**	Force ordered tag if necessary to avoid timeouts 
 		**	and to preserve interactivity.
 		*/
-		if (lp && ktime_exp(lp->tags_stime)) {
+		if (lp && Ktime_exp(lp->tags_stime)) {
 			if (lp->tags_smap) {
 				order = M_ORDERED_TAG;
 				if ((DEBUG_FLAGS & DEBUG_TAGS)||bootverbose>2){ 
@@ -3524,7 +3524,7 @@ static int ncr_queue_command (struct ncb
 						"ordered tag forced.\n");
 				}
 			}
-			lp->tags_stime = ktime_get(3*HZ);
+			lp->tags_stime = Ktime_get(3*HZ);
 			lp->tags_smap = lp->tags_umap;
 		}
 
@@ -3792,7 +3792,7 @@ static int ncr_reset_scsi_bus(struct ncb
 	u32 term;
 	int retv = 0;
 
-	np->settle_time	= ktime_get(settle_delay * HZ);
+	np->settle_time	= Ktime_get(settle_delay * HZ);
 
 	if (bootverbose > 1)
 		printk("%s: resetting, "
@@ -5044,7 +5044,7 @@ static void ncr_setup_tags (struct ncb *
 
 static void ncr_timeout (struct ncb *np)
 {
-	u_long	thistime = ktime_get(0);
+	u_long	thistime = Ktime_get(0);
 
 	/*
 	**	If release process in progress, let's go
@@ -5057,7 +5057,7 @@ static void ncr_timeout (struct ncb *np)
 		return;
 	}
 
-	np->timer.expires = ktime_get(SCSI_NCR_TIMER_INTERVAL);
+	np->timer.expires = Ktime_get(SCSI_NCR_TIMER_INTERVAL);
 	add_timer(&np->timer);
 
 	/*
@@ -5336,8 +5336,8 @@ void ncr_exception (struct ncb *np)
 	**=========================================================
 	*/
 
-	if (ktime_exp(np->regtime)) {
-		np->regtime = ktime_get(10*HZ);
+	if (Ktime_exp(np->regtime)) {
+		np->regtime = Ktime_get(10*HZ);
 		for (i = 0; i<sizeof(np->regdump); i++)
 			((char*)&np->regdump)[i] = INB_OFF(i);
 		np->regdump.nc_dstat = dstat;
@@ -5453,7 +5453,7 @@ static int ncr_int_sbmc (struct ncb *np)
 		**	Suspend command processing for 1 second and 
 		**	reinitialize all except the chip.
 		*/
-		np->settle_time	= ktime_get(1*HZ);
+		np->settle_time	= Ktime_get(1*HZ);
 		ncr_init (np, 0, bootverbose ? "scsi mode change" : NULL, HS_RESET);
 		return 1;
 	}
@@ -6923,7 +6923,7 @@ static struct lcb *ncr_setup_lcb (struct
 		for (i = 0 ; i < MAX_TAGS ; i++)
 			lp->cb_tags[i] = i;
 		lp->maxnxs = MAX_TAGS;
-		lp->tags_stime = ktime_get(3*HZ);
+		lp->tags_stime = Ktime_get(3*HZ);
 		ncr_setup_tags (np, sdev);
 	}
 
drivers/scsi/sym53c8xx_defs.h renamed from drivers/scsi/sym53c8xx_defs.h~cleanup-namespace-collision-with-ktimers-in +5 -5
diff -puN drivers/scsi/sym53c8xx_defs.h~cleanup-namespace-collision-with-ktimers-in drivers/scsi/sym53c8xx_defs.h
@@ -285,12 +285,12 @@
 **	kernel time values (jiffies) to some that have 
 **	chance not to be too much incorrect. :-)
 */
-#define ktime_get(o)		(jiffies + (u_long) o)
-#define ktime_exp(b)		((long)(jiffies) - (long)(b) >= 0)
-#define ktime_dif(a, b)		((long)(a) - (long)(b))
+#define Ktime_get(o)		(jiffies + (u_long) o)
+#define Ktime_exp(b)		((long)(jiffies) - (long)(b) >= 0)
+#define Ktime_dif(a, b)		((long)(a) - (long)(b))
 /* These ones are not used in this driver */
-#define ktime_add(a, o)		((a) + (u_long)(o))
-#define ktime_sub(a, o)		((a) - (u_long)(o))
+#define Ktime_add(a, o)		((a) + (u_long)(o))
+#define Ktime_sub(a, o)		((a) - (u_long)(o))
 
 
 /*

_

#1 lore raw
Quoted 2 lines · On Tue, Oct 25, 2005 at 10:55:12AM -0700, [email protected] wrote:

Rename the time related macros in *53c8xx.* to cleanup the namespace collision introduced by the ktimers patch.

wowYuckMixedCase?WhatIsThisJava?

How about we just delete that crap instead? It boots ... but I've been up for 20 hours at this point, so I'm not prepared to guarantee I got all the conversions right.

Index: drivers/scsi/ncr53c8xx.c
===================================================================
RCS file: /var/cvs/linux-2.6/drivers/scsi/ncr53c8xx.c,v retrieving revision 1.35

scsi/ncr53c8xx.c +11 -11
diff -u -p -r1.35 ncr53c8xx.c
@@ -3481,8 +3481,8 @@ static int ncr_queue_command (struct ncb
 	**----------------------------------------------------
 	*/
 	if (np->settle_time && cmd->timeout_per_command >= HZ) {
-		u_long tlimit = ktime_get(cmd->timeout_per_command - HZ);
-		if (ktime_dif(np->settle_time, tlimit) > 0)
+		u_long tlimit = jiffies + cmd->timeout_per_command - HZ;
+		if (time_after(np->settle_time, tlimit))
 			np->settle_time = tlimit;
 	}
 
@@ -3516,7 +3516,7 @@ static int ncr_queue_command (struct ncb
 		**	Force ordered tag if necessary to avoid timeouts 
 		**	and to preserve interactivity.
 		*/
-		if (lp && ktime_exp(lp->tags_stime)) {
+		if (lp && time_after(jiffies, lp->tags_stime)) {
 			if (lp->tags_smap) {
 				order = M_ORDERED_TAG;
 				if ((DEBUG_FLAGS & DEBUG_TAGS)||bootverbose>2){ 
@@ -3524,7 +3524,7 @@ static int ncr_queue_command (struct ncb
 						"ordered tag forced.\n");
 				}
 			}
-			lp->tags_stime = ktime_get(3*HZ);
+			lp->tags_stime = jiffies + 3*HZ;
 			lp->tags_smap = lp->tags_umap;
 		}
 
@@ -3792,7 +3792,7 @@ static int ncr_reset_scsi_bus(struct ncb
 	u32 term;
 	int retv = 0;
 
-	np->settle_time	= ktime_get(settle_delay * HZ);
+	np->settle_time	= jiffies + settle_delay * HZ;
 
 	if (bootverbose > 1)
 		printk("%s: resetting, "
@@ -5044,7 +5044,7 @@ static void ncr_setup_tags (struct ncb *
 
 static void ncr_timeout (struct ncb *np)
 {
-	u_long	thistime = ktime_get(0);
+	u_long	thistime = jiffies;
 
 	/*
 	**	If release process in progress, let's go
@@ -5057,7 +5057,7 @@ static void ncr_timeout (struct ncb *np)
 		return;
 	}
 
-	np->timer.expires = ktime_get(SCSI_NCR_TIMER_INTERVAL);
+	np->timer.expires = jiffies + SCSI_NCR_TIMER_INTERVAL;
 	add_timer(&np->timer);
 
 	/*
@@ -5336,8 +5336,8 @@ void ncr_exception (struct ncb *np)
 	**=========================================================
 	*/
 
-	if (ktime_exp(np->regtime)) {
-		np->regtime = ktime_get(10*HZ);
+	if (time_after(jiffies, np->regtime)) {
+		np->regtime = jiffies + 10*HZ;
 		for (i = 0; i<sizeof(np->regdump); i++)
 			((char*)&np->regdump)[i] = INB_OFF(i);
 		np->regdump.nc_dstat = dstat;
@@ -5453,7 +5453,7 @@ static int ncr_int_sbmc (struct ncb *np)
 		**	Suspend command processing for 1 second and 
 		**	reinitialize all except the chip.
 		*/
-		np->settle_time	= ktime_get(1*HZ);
+		np->settle_time	= jiffies + HZ;
 		ncr_init (np, 0, bootverbose ? "scsi mode change" : NULL, HS_RESET);
 		return 1;
 	}
@@ -6923,7 +6923,7 @@ static struct lcb *ncr_setup_lcb (struct
 		for (i = 0 ; i < MAX_TAGS ; i++)
 			lp->cb_tags[i] = i;
 		lp->maxnxs = MAX_TAGS;
-		lp->tags_stime = ktime_get(3*HZ);
+		lp->tags_stime = jiffies + 3*HZ;
 		ncr_setup_tags (np, sdev);
 	}
 

Index: drivers/scsi/sym53c8xx_defs.h
===================================================================
RCS file: /var/cvs/linux-2.6/drivers/scsi/sym53c8xx_defs.h,v retrieving revision 1.13

scsi/sym53c8xx_defs.h +0 -13
diff -u -p -r1.13 sym53c8xx_defs.h
@@ -281,19 +281,6 @@
 #endif
 
 /*
-**	These simple macros limit expression involving 
-**	kernel time values (jiffies) to some that have 
-**	chance not to be too much incorrect. :-)
-*/
-#define ktime_get(o)		(jiffies + (u_long) o)
-#define ktime_exp(b)		((long)(jiffies) - (long)(b) >= 0)
-#define ktime_dif(a, b)		((long)(a) - (long)(b))
-/* These ones are not used in this driver */
-#define ktime_add(a, o)		((a) + (u_long)(o))
-#define ktime_sub(a, o)		((a) - (u_long)(o))
-
-
-/*
  *  IO functions definition for big/little endian CPU support.
  *  For now, the NCR is only supported in little endian addressing mode, 
  */
#2 lore raw
Quoted 9 lines · Matthew Wilcox
Quoted 2 lines · On Tue, Oct 25, 2005 at 10:55:12AM -0700, [email protected] wrote:

Rename the time related macros in *53c8xx.* to cleanup the namespace collision introduced by the ktimers patch.

wowYuckMixedCase?WhatIsThisJava?

How about we just delete that crap instead? It boots ... but I've been up for 20 hours at this point, so I'm not prepared to guarantee I got all the conversions right.

Yeah, removing the ktime_ mess sounds much better.