Re: Wrong operators for the binary.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Jose Luis Alarcon (jlalarcon@tiggerfan.com) wrote:
> 
>   The "solution" comes adding '.value' to the expression with '&', in this way:
> 
> printk("Device: %d.%d\n", (inode->i_rdev).value >> 8, (inode->i_rdev).value &
> Oxff);

You don't want to do this.  What you are doing is manually extracting
the major and minor device numbers.  Use the existing kernel primitives
for kdev_t types, so that your code will work when major/minor is no
longer 8/8 but 12/20 as proposed for future.  See major() and minor()
from include/linux/kdev_t.h.

-chris
-- 
Linux Security Modules     http://lsm.immunix.org     http://lsm.bkbits.net
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux