Skip to contentSkip to conversation

: c-r4k.c 1/7 s/switch/formula/

PATCH In review Juan Quintela 2 participants 2 messages Mar 28, 2003 – Mar 29, 2003 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : c-r4k.c 1/7 s/switch/formula/

Hi
use the same calculation for sc_size as in every other *_size.

Later, Juan.

 build/arch/mips/mm/c-r4k.c |   15 +--------------
 1 files changed, 1 insertion(+), 14 deletions(-)
build/arch/mips/mm/c-r4k.c renamed from build/arch/mips/mm/c-r4k.c~c-r4k_remove_switch +1 -14
diff -puN build/arch/mips/mm/c-r4k.c~c-r4k_remove_switch build/arch/mips/mm/c-r4k.c
@@ -635,20 +635,7 @@ static int __init probe_scache(unsigned 
 	if ((config >> 17) & 1)
 		return 0;
 
-	switch ((config >> 22) & 3) {
-	case 0:
-		sc_lsize = 16;
-		break;
-	case 1:
-		sc_lsize = 32;
-		break;
-	case 2:
-		sc_lsize = 64;
-		break;
-	case 3:
-		sc_lsize = 128;
-		break;
-	}
+	sc_lsize = 16 << ((config >> 22) & 3);
 
 	begin = (unsigned long) &stext;
 	begin &= ~((4 * 1024 * 1024) - 1);

_

Signature · 2 lines
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy
#1 lore raw
Quoted 1 line · Juan Quintela

use the same calculation for sc_size as in every other *_size.

Thanks, this pointless switch has been on my list for a while.

Ralf