diff mbox series

[net,2/2] ptp: uapi: change _IOW to IOWR in PTP_SYS_OFFSET_EXTENDED definition

Message ID 20190107152238.GA18065@asgard.redhat.com
State Accepted
Delegated to: David Miller
Headers show
Series [net,1/2] ptp: check that rsv field is zero in struct ptp_sys_offset_extended | expand

Commit Message

Eugene Syromiatnikov Jan. 7, 2019, 3:22 p.m. UTC
The ioctl command is read/write (or just read, if the fact that user space
writes n_samples field is ignored).

Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
---
 include/uapi/linux/ptp_clock.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller Jan. 7, 2019, 4:29 p.m. UTC | #1
From: Eugene Syromiatnikov <esyr@redhat.com>
Date: Mon, 7 Jan 2019 16:22:38 +0100

> --- a/include/uapi/linux/ptp_clock.h
> +++ b/include/uapi/linux/ptp_clock.h
> @@ -147,7 +147,7 @@ struct ptp_pin_desc {
>  #define PTP_SYS_OFFSET_PRECISE \
>  	_IOWR(PTP_CLK_MAGIC, 8, struct ptp_sys_offset_precise)
>  #define PTP_SYS_OFFSET_EXTENDED \
> -	_IOW(PTP_CLK_MAGIC, 9, struct ptp_sys_offset_extended)
> +	_IOWR(PTP_CLK_MAGIC, 9, struct ptp_sys_offset_extended)

Again, this changes the ioctl cmd value and will break userspace.
diff mbox series

Patch

diff --git a/include/uapi/linux/ptp_clock.h b/include/uapi/linux/ptp_clock.h
index d73d839..1bc794a 100644
--- a/include/uapi/linux/ptp_clock.h
+++ b/include/uapi/linux/ptp_clock.h
@@ -147,7 +147,7 @@  struct ptp_pin_desc {
 #define PTP_SYS_OFFSET_PRECISE \
 	_IOWR(PTP_CLK_MAGIC, 8, struct ptp_sys_offset_precise)
 #define PTP_SYS_OFFSET_EXTENDED \
-	_IOW(PTP_CLK_MAGIC, 9, struct ptp_sys_offset_extended)
+	_IOWR(PTP_CLK_MAGIC, 9, struct ptp_sys_offset_extended)
 
 struct ptp_extts_event {
 	struct ptp_clock_time t; /* Time event occured. */