#ifndef UTILS_H #define UTILS_H #include #include /* For LINUX_VERSION_CODE */ MODULE_LICENSE("GPL"); MODULE_AUTHOR("Leonardo Tamiano"); #define MODNAME "AOS PROJECT 2019/2020" #define DEVICE_NAME "timed-messaging-dev" #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0) #define get_major(session) MAJOR(session->f_inode->i_rdev) #define get_minor(session) MINOR(session->f_inode->i_rdev) #else #define get_major(session) MAJOR(session->f_dentry->d_inode->i_rdev) #define get_minor(session) MINOR(session->f_dentry->d_inode->i_rdev) #endif #endif