Skip to contentSkip to conversation

PATCH: rio driver, boot code (1 of 3)

PATCH Alan Cox 3 participants 5 messages Feb 14, 2006 Char and misc drivers

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

This patch expands the HOST_DISABLE macro in rioboot.c. This is good anyway to remove obfuscation but also neccessary so that indent will process the file correctly.

drivers/char/rio/rioboot.c +12 -10
@@ -493,14 +493,10 @@
 		if ( RWORD(HostP->__ParmMapR) == OldParmMap ) {
 			rio_dprintk (RIO_DEBUG_BOOT, "parmmap 0x%x\n", RWORD(HostP->__ParmMapR));
 			rio_dprintk (RIO_DEBUG_BOOT, "RIO Mesg Run Fail\n");
-
-#define	HOST_DISABLE \
-		HostP->Flags &= ~RUN_STATE; \
-		HostP->Flags |= RC_STUFFED; \
-		RIOHostReset( HostP->Type, (struct DpRam *)HostP->CardP, HostP->Slot );\
-		continue
-
-			HOST_DISABLE;
+			HostP->Flags &= ~RUN_STATE; \
+			HostP->Flags |= RC_STUFFED; \
+			RIOHostReset( HostP->Type, (struct DpRam *)HostP->CardP, HostP->Slot );\
+			continue
 		}
 
 		rio_dprintk (RIO_DEBUG_BOOT, "Running 0x%x\n", RWORD(HostP->__ParmMapR));
@@ -528,7 +524,10 @@
 		if ( (RWORD(ParmMapP->links) & 0xFFFF) != 0xFFFF ) {
 			rio_dprintk (RIO_DEBUG_BOOT, "RIO Mesg Run Fail %s\n", HostP->Name);
 			rio_dprintk (RIO_DEBUG_BOOT, "Links = 0x%x\n",RWORD(ParmMapP->links));
-			HOST_DISABLE;
+			HostP->Flags &= ~RUN_STATE; \
+			HostP->Flags |= RC_STUFFED; \
+			RIOHostReset( HostP->Type, (struct DpRam *)HostP->CardP, HostP->Slot );\
+			continue
 		}
 
 		WWORD(ParmMapP->links , RIO_LINK_ENABLE);
@@ -550,7 +549,10 @@
 							!RWORD(ParmMapP->init_done) ) {
 			rio_dprintk (RIO_DEBUG_BOOT, "RIO Mesg Run Fail %s\n", HostP->Name);
 			rio_dprintk (RIO_DEBUG_BOOT, "Timedout waiting for init_done\n");
-			HOST_DISABLE;
+			HostP->Flags &= ~RUN_STATE; \
+			HostP->Flags |= RC_STUFFED; \
+			RIOHostReset( HostP->Type, (struct DpRam *)HostP->CardP, HostP->Slot );\
+			continue
 		}
 
 		rio_dprintk (RIO_DEBUG_BOOT, "Got init_done\n");
#1 lore raw
Quoted 16 lines · Alan Cox

This patch expands the HOST_DISABLE macro in rioboot.c. This is good anyway to remove obfuscation but also neccessary so that indent will process the file correctly.

--- linux.vanilla-2.6.16-rc3/drivers/char/rio/rioboot.c 2006-02-14
17:08:55.000000000 +0000 +++
linux-2.6.16-rc3/drivers/char/rio/rioboot.c 2006-02-14 19:07:26.551366016
+0000 @@ -493,14 +493,10 @@

(quoted diff) +0 -0
 		if ( RWORD(HostP->__ParmMapR) == OldParmMap ) {
 			rio_dprintk (RIO_DEBUG_BOOT, "parmmap 0x%x\n",

RWORD(HostP->__ParmMapR)); rio_dprintk (RIO_DEBUG_BOOT, "RIO Mesg Run Fail\n");

drivers/char/rio/rioboot.c +0 -2
-
-#define	HOST_DISABLE \

drivers/char/rio/rioboot.c line 499

Quoted 10 lines
drivers/char/rio/rioboot.c +4 -6
-		HostP->Flags &= ~RUN_STATE; \
-		HostP->Flags |= RC_STUFFED; \
-		RIOHostReset( HostP->Type, (struct DpRam *)HostP->CardP, HostP->Slot );\
-		continue
-
-			HOST_DISABLE;
+			HostP->Flags &= ~RUN_STATE; \
+			HostP->Flags |= RC_STUFFED; \
+			RIOHostReset( HostP->Type, (struct DpRam *)HostP->CardP, HostP->Slot);\ 
+			continue

Missing semicolon, maybe lose the \ .

drivers/char/rio/rioboot.c line 530

Quoted 12 lines
(quoted diff) +0 -0
 		}
 
 		rio_dprintk (RIO_DEBUG_BOOT, "Running 0x%x\n",

RWORD(HostP->__ParmMapR)); @@ -528,7 +524,10 @@

drivers/char/rio/rioboot.c +4 -1
 		if ( (RWORD(ParmMapP->links) & 0xFFFF) != 0xFFFF ) {
 			rio_dprintk (RIO_DEBUG_BOOT, "RIO Mesg Run Fail %s\n", HostP->Name);
 			rio_dprintk (RIO_DEBUG_BOOT, "Links = 0x%x\n",RWORD(ParmMapP->links));
-			HOST_DISABLE;
+			HostP->Flags &= ~RUN_STATE; \
+			HostP->Flags |= RC_STUFFED; \
+			RIOHostReset( HostP->Type, (struct DpRam *)HostP->CardP, HostP->Slot);\ 
+			continue

Ditto.

Quoted 11 lines
drivers/char/rio/rioboot.c +3 -1
 		}
 
 		WWORD(ParmMapP->links , RIO_LINK_ENABLE);
@@ -550,7 +549,10 @@
 							!RWORD(ParmMapP->init_done) ) {
 			rio_dprintk (RIO_DEBUG_BOOT, "RIO Mesg Run Fail %s\n", HostP->Name);
 			rio_dprintk (RIO_DEBUG_BOOT, "Timedout waiting for init_done\n");
-			HOST_DISABLE;
+			HostP->Flags &= ~RUN_STATE; \
+			HostP->Flags |= RC_STUFFED; \
+			RIOHostReset( HostP->Type, (struct DpRam *)HostP->CardP, HostP->Slot
Quoted 1 line

);\ + continue

Aaand the same.. another reason why macros like these are evil.

Signature · 6 lines
Cheers,
Alistair.

'No sense being pessimistic, it probably wouldn't work anyway.'
Third year Computer Science undergraduate.
1F2 55 South Clerk Street, Edinburgh, UK.
author
#2 lore raw
Quoted 4 lines · Alistair John Strachan

Missing semicolon, maybe lose the \ .

Quoted 2 lines

}

Quoted 12 lines

drivers/char/rio/rioboot.c line 530

Quoted 10 lines

rio_dprintk (RIO_DEBUG_BOOT, "Running 0x%x\n",
RWORD(HostP->__ParmMapR)); @@ -528,7 +524,10 @@

drivers/char/rio/rioboot.c +4 -1
 		if ( (RWORD(ParmMapP->links) & 0xFFFF) != 0xFFFF ) {
 			rio_dprintk (RIO_DEBUG_BOOT, "RIO Mesg Run Fail %s\n", HostP->Name);
 			rio_dprintk (RIO_DEBUG_BOOT, "Links = 0x%x\n",RWORD(ParmMapP->links));
-			HOST_DISABLE;
+			HostP->Flags &= ~RUN_STATE; \
+			HostP->Flags |= RC_STUFFED; \
+			RIOHostReset( HostP->Type, (struct DpRam *)HostP->CardP, HostP->Slot);\ 
+			continue

Ditto.

Harmless but yes I'll send a diff to clean them up once the other three are applied.

#3 lore raw
Quoted 3 lines · Alan Cox

Harmless but yes I'll send a diff to clean them up once the other three are applied.

Not harmless. The other patches seem to assume that the first one was _not_ done. IOW, patch #2 contains:

-
-#define HOST_DISABLE \
- HostP->Flags &= ~RUN_STATE; \
- HostP->Flags |= RC_STUFFED; \
- RIOHostReset( HostP->Type, (struct DpRam *)HostP->CardP, HostP->Slot );\
- continue
-
- HOST_DISABLE;

and will thus obviously not apply at all if patch #1 was applied.

It looks like the indent was done _after_ patch #1 was applied, but then the result was diffed against the state _before_ patch #1 was applied.

So I'll flush the series, hoping for a corrected one that actually applies in order..

Linus

author
#4 lore raw
Quoted 2 lines · Linus Torvalds

It looks like the indent was done _after_ patch #1 was applied, but then the result was diffed against the state _before_ patch #1 was applied.

Umm yes, so just apply #2 and #3. Sorry about that. I can send you a single patch with the lot if you want but I didn't archive the inbetween states