Commit b9119bf1 authored by Paul Mackerras's avatar Paul Mackerras Committed by Paul Mackerras

PPC32: Simplify the code in arch/ppc/kernel/ppc_htab.c a bit

(no change in function).
parent 19d3de67
...@@ -117,7 +117,6 @@ static ssize_t ppc_htab_read(struct file * file, char * buf, ...@@ -117,7 +117,6 @@ static ssize_t ppc_htab_read(struct file * file, char * buf,
#ifdef CONFIG_PPC_STD_MMU #ifdef CONFIG_PPC_STD_MMU
unsigned int kptes = 0, uptes = 0; unsigned int kptes = 0, uptes = 0;
PTE *ptr; PTE *ptr;
struct task_struct *p;
#endif /* CONFIG_PPC_STD_MMU */ #endif /* CONFIG_PPC_STD_MMU */
char buffer[512]; char buffer[512];
...@@ -150,22 +149,18 @@ static ssize_t ppc_htab_read(struct file * file, char * buf, ...@@ -150,22 +149,18 @@ static ssize_t ppc_htab_read(struct file * file, char * buf,
goto return_string; goto return_string;
} }
for ( ptr = Hash ; ptr < Hash_end ; ptr++) for (ptr = Hash; ptr < Hash_end; ptr++) {
{ unsigned int mctx, vsid;
unsigned int ctx, mctx, vsid;
if (!ptr->v) if (!ptr->v)
continue; continue;
/* make sure someone is using this context/vsid */ /* undo the esid skew */
/* first undo the esid skew */
vsid = ptr->vsid; vsid = ptr->vsid;
mctx = ((vsid - (vsid & 0xf) * 0x111) >> 4) & 0xfffff; mctx = ((vsid - (vsid & 0xf) * 0x111) >> 4) & 0xfffff;
if (mctx == 0) { if (mctx == 0)
kptes++; kptes++;
continue; else
} uptes++;
/* now undo the context skew; 801921 * 897 == 1 mod 2^20 */
ctx = (mctx * 801921) & 0xfffff;
} }
n += sprintf( buffer + n, n += sprintf( buffer + n,
...@@ -196,7 +191,7 @@ static ssize_t ppc_htab_read(struct file * file, char * buf, ...@@ -196,7 +191,7 @@ static ssize_t ppc_htab_read(struct file * file, char * buf,
primary_pteg_full, htab_evicts); primary_pteg_full, htab_evicts);
return_string: return_string:
#endif /* CONFIG_PPC_STD_MMU */ #endif /* CONFIG_PPC_STD_MMU */
n += sprintf( buffer + n, n += sprintf( buffer + n,
"Non-error misses: %lu\n" "Non-error misses: %lu\n"
"Error misses\t: %lu\n", "Error misses\t: %lu\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment