I need to do an integer division in a kernel module and I am using do_div() for that. It seems to work on my machine (I have an i686 processor), however I am not sure that it works everywhere. Could anyone confirm whether do_div()
should function correctly in 32 bit and 64 bit architectures, or whether there are any know limitations ?
I use Ubuntu 10.04 with kernel 2.6.38, so I am interested in support for kernels >= 2.6.38.
I would also be interested if anyone knows a better way to do an integer division in the kernel than do_div()
.
Best Regards
Daniel