Good spotting. Fixed. It might actually make a difference for somebody.
>Also, why is pg0[0] being set anyway? Any access to that location
>would seem to always be an error. In the first case, the mem_init
>code resets pg0[0] to the original value so any change here is
>ignored. In the second case, pg0[0] does not seem to be the correct
>PTE either (swapper_pg_dir[0] is cleared in paging_init).
It's being set because it's being used to test the WP bit - if we don't
set it then we couldn't return to the code that tests it. See the file
arch/i386/mm/init.c (and the "wp_works_ok" variable in particular).
This is all just to support the i386 WP-doesn't-work-in-supervisor-mode
bug,
Linus