LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   compile error: invalid operands for binary >> for pgd_index(addr) macro (https://www.linuxquestions.org/questions/linux-kernel-70/compile-error-invalid-operands-for-binary-for-pgd_index-addr-macro-732024/)

rashmikant 06-10-2009 03:19 PM

compile error: invalid operands for binary >> for pgd_index(addr) macro
 
Hi all,
I am writing a driver for a pci device and am trying to translate a virtual address to locate its page table entry using the set of macros in asm/pgtable.h

I am giving a void * to pgd_index(addr) macro to give me a relative position in Page global directory.
But instead while compiling, it gives me an error saying:
error: invalid operands to binary >> (have void * and 'int')

I don't understand what is wrong because as I know, I am supposed to pass a virtual address to the macro to get the pgd index.

Thanks for help.

Rashmikant

rashmikant 06-10-2009 03:36 PM

i figured it out. The macro requires an unsigned long to resolve the error. But I dont understand why because the definition of macro says it requires a void pointer.

Rashmikant


All times are GMT -5. The time now is 07:29 AM.