]> git.neil.brown.name Git - history.git/commitdiff
PPC32: Simplify the code in arch/ppc/kernel/ppc_htab.c a bit
authorPaul Mackerras <paulus@au1.ibm.com>
Sat, 21 Sep 2002 00:39:35 +0000 (10:39 +1000)
committerPaul Mackerras <paulus@samba.org>
Sat, 21 Sep 2002 00:39:35 +0000 (10:39 +1000)
(no change in function).

arch/ppc/kernel/ppc_htab.c

index 875233153fded95bb4596eae82f1a0874c1678ad..57111fd7eb2f4de31cc730c6cc9a2d8dae2d073b 100644 (file)
@@ -117,7 +117,6 @@ static ssize_t ppc_htab_read(struct file * file, char * buf,
 #ifdef CONFIG_PPC_STD_MMU
        unsigned int kptes = 0, uptes = 0;
        PTE *ptr;
-       struct task_struct *p;
 #endif /* CONFIG_PPC_STD_MMU */
        char buffer[512];
 
@@ -150,22 +149,18 @@ static ssize_t ppc_htab_read(struct file * file, char * buf,
                goto return_string;
        }
 
-       for ( ptr = Hash ; ptr < Hash_end ; ptr++)
-       {
-               unsigned int ctx, mctx, vsid;
+       for (ptr = Hash; ptr < Hash_end; ptr++) {
+               unsigned int mctx, vsid;
 
                if (!ptr->v)
                        continue;
-               /* make sure someone is using this context/vsid */
-               /* first undo the esid skew */
+               /* undo the esid skew */
                vsid = ptr->vsid;
                mctx = ((vsid - (vsid & 0xf) * 0x111) >> 4) & 0xfffff;
-               if (mctx == 0) {
+               if (mctx == 0)
                        kptes++;
-                       continue;
-               }
-               /* now undo the context skew; 801921 * 897 == 1 mod 2^20 */
-               ctx = (mctx * 801921) & 0xfffff;
+               else
+                       uptes++;
        }
        
        n += sprintf( buffer + n,
@@ -196,7 +191,7 @@ static ssize_t ppc_htab_read(struct file * file, char * buf,
                      primary_pteg_full, htab_evicts);
 return_string:
 #endif /* CONFIG_PPC_STD_MMU */
-       
+
        n += sprintf( buffer + n,
                      "Non-error misses: %lu\n"
                      "Error misses\t: %lu\n",