Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/include/linux/fs.h
| Show First 20 Lines • Show All 426 Lines • ▼ Show 20 Lines | ssize_t simple_attr_read(struct file *filp, char __user *buf, size_t read_size, | ||||
| loff_t *ppos); | loff_t *ppos); | ||||
| ssize_t simple_attr_write(struct file *filp, const char __user *buf, | ssize_t simple_attr_write(struct file *filp, const char __user *buf, | ||||
| size_t write_size, loff_t *ppos); | size_t write_size, loff_t *ppos); | ||||
| ssize_t simple_attr_write_signed(struct file *filp, const char __user *buf, | ssize_t simple_attr_write_signed(struct file *filp, const char __user *buf, | ||||
| size_t write_size, loff_t *ppos); | size_t write_size, loff_t *ppos); | ||||
| static inline long | |||||
| compat_ptr_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||||
| { | |||||
| if (file->f_op->unlocked_ioctl == NULL) { | |||||
| return (-ENOIOCTLCMD); | |||||
dumbbell: `arg` is already an unsigned long, the cast is not needed. | |||||
| } | |||||
| return (file->f_op->unlocked_ioctl(file, cmd, arg)); | |||||
Done Inline ActionsI would swap the logic like this: if (unlocked_ioctl == NULL) return (-ENOIOCTLCMD); return (file->...); dumbbell: I would swap the logic like this:
if (unlocked_ioctl == NULL)
return (-ENOIOCTLCMD)… | |||||
Done Inline ActionsDone/Amended siri_racha.ca: Done/Amended | |||||
| } | |||||
| #endif /* _LINUXKPI_LINUX_FS_H_ */ | #endif /* _LINUXKPI_LINUX_FS_H_ */ | ||||
arg is already an unsigned long, the cast is not needed.