Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d38e0e3f authored by Colin Cross's avatar Colin Cross Committed by Greg Kroah-Hartman
Browse files

Revert "Staging: Android alarm: IOCTL command encoding fix"



Commit 6bd4a5d9 changed the
ANDROID_ALARM_GET_TIME ioctls from IOW to IOR.  While technically
correct, the _IOC_DIR bits are ignored by alarm_ioctl, so the
commit breaks a userspace ABI used by all existing Android devices
for a purely cosmetic reason.  Revert it.

Cc: stable <stable@vger.kernel.org>
Cc: Dae S. Kim <dae@velatum.com>
Signed-off-by: default avatarColin Cross <ccross@android.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 77b67063
Loading
Loading
Loading
Loading
+1 −3
Original line number Original line Diff line number Diff line
@@ -51,12 +51,10 @@ enum android_alarm_return_flags {
#define ANDROID_ALARM_WAIT                  _IO('a', 1)
#define ANDROID_ALARM_WAIT                  _IO('a', 1)


#define ALARM_IOW(c, type, size)            _IOW('a', (c) | ((type) << 4), size)
#define ALARM_IOW(c, type, size)            _IOW('a', (c) | ((type) << 4), size)
#define ALARM_IOR(c, type, size)            _IOR('a', (c) | ((type) << 4), size)

/* Set alarm */
/* Set alarm */
#define ANDROID_ALARM_SET(type)             ALARM_IOW(2, type, struct timespec)
#define ANDROID_ALARM_SET(type)             ALARM_IOW(2, type, struct timespec)
#define ANDROID_ALARM_SET_AND_WAIT(type)    ALARM_IOW(3, type, struct timespec)
#define ANDROID_ALARM_SET_AND_WAIT(type)    ALARM_IOW(3, type, struct timespec)
#define ANDROID_ALARM_GET_TIME(type)        ALARM_IOR(4, type, struct timespec)
#define ANDROID_ALARM_GET_TIME(type)        ALARM_IOW(4, type, struct timespec)
#define ANDROID_ALARM_SET_RTC               _IOW('a', 5, struct timespec)
#define ANDROID_ALARM_SET_RTC               _IOW('a', 5, struct timespec)
#define ANDROID_ALARM_BASE_CMD(cmd)         (cmd & ~(_IOC(0, 0, 0xf0, 0)))
#define ANDROID_ALARM_BASE_CMD(cmd)         (cmd & ~(_IOC(0, 0, 0xf0, 0)))
#define ANDROID_ALARM_IOCTL_TO_TYPE(cmd)    (_IOC_NR(cmd) >> 4)
#define ANDROID_ALARM_IOCTL_TO_TYPE(cmd)    (_IOC_NR(cmd) >> 4)