#define CMD_ERR_PRINT(devname, cmd, arg) do { \
char *p[4] = {"", "W", "R", "WR"}; \
if (0 == _IOC_DIR(cmd)) { \
printk(KERN_ERR "ERROR: /dev/%s not find cmd(%#x): _IO('%c', %d), called by pname=%s, pid=%d\n", \
devname, cmd, _IOC_TYPE(cmd), _IOC_NR(cmd), current->comm, current->pid); \
} else { \
printk(KERN_ERR "ERROR: /dev/%s not find cmd(%#x): _IO%s('%c', %d, 0x%p), called by pname=%s, pid=%d\n", \
devname, cmd, p[_IOC_DIR(cmd)], _IOC_TYPE(cmd), _IOC_NR(cmd), (void *)arg, current->comm, current->pid); \
} \
} while (0)