-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 While reading "Linux Device Drivers 2nd Edition" I found what I think is an error in the implementation of the VMA nopage method in the module called `simple'. In fact the code says /* * The nopage version. */ struct page *simple_vma_nopage(struct vm_area_struct *vma, unsigned long address, int write_access) { struct page *pageptr; unsigned long physaddr = address - vma->vm_start + VMA_OFFSET(vma); pageptr = virt_to_page(__va(physaddr)); get_page(pageptr); return pageptr; } Well VMA nopage method accepts as second parameter the *virtual* address which raised the fault, rounded down to the begininng of the page. In the same way, vma->vm_start is the *virtual* address of the VMA and VMA_OFFSET(vma) simply defines an offset. Obvioulsy here we are dealing with a *virtual* address... so there should be no need to call __va() on it before calling virt_to_page(). Am I missing something? Regards. - -- Angelo Dell'Aera 'buffer' Antifork Research, Inc. http://buffer.antifork.org PGP information in e-mail header -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/YKQEpONIzxnBXKIRAlxdAJ9vKNdvqB+i1a5FUiapflx4+tLBOQCePUKF ydCW089LBwfRCPXV+j16vZk= =irwd -----END PGP SIGNATURE----- -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/