I have a bitmap that I need to debug, and it would be much easier for me to printk the number in binary rather than decimal. Can I do this?
Perhaps try hex or octal:
printk("%02X", mybyte);
printk("%03o", mybyte);
There is a function to print a binary value in arch/parisc/kernel/traps.c, called printbinary(). You can copy it into your code (or just link it if you happen to be on parisc). Better still move it somewhere generic in the kernel tree, eg. lib, and send a patch to LKML.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With