Skip to content

Commit 68fc022

Browse files
committed
Fix retrieve user value in IOCTL_VALSET_NUM
Replace _IOW with _IO macro to reflect that IOCTL_VALSET_NUM passes the integer value directly via arg, consistent with the calling convention used throughout this codebase. Restore the handler to assign arg directly to ioctl_num.
1 parent 6f0b5cc commit 68fc022

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/ioctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct ioctl_arg {
2020
#define IOCTL_VALSET _IOW(IOC_MAGIC, 0, struct ioctl_arg)
2121
#define IOCTL_VALGET _IOR(IOC_MAGIC, 1, struct ioctl_arg)
2222
#define IOCTL_VALGET_NUM _IOR(IOC_MAGIC, 2, int)
23-
#define IOCTL_VALSET_NUM _IOW(IOC_MAGIC, 3, int)
23+
#define IOCTL_VALSET_NUM _IO(IOC_MAGIC, 3)
2424

2525
#define IOCTL_VAL_MAXNR 3
2626
#define DRIVER_NAME "ioctltest"

0 commit comments

Comments
 (0)