]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.6.8/revert-staging-android-alarm-ioctl-command-encoding-fix.patch
Fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 3.6.8 / revert-staging-android-alarm-ioctl-command-encoding-fix.patch
CommitLineData
1df8150e
GKH
1From d38e0e3fed4f58bcddef4dc93a591dfe2f651cb0 Mon Sep 17 00:00:00 2001
2From: Colin Cross <ccross@android.com>
3Date: Wed, 7 Nov 2012 18:21:51 -0800
4Subject: Revert "Staging: Android alarm: IOCTL command encoding fix"
5
6From: Colin Cross <ccross@android.com>
7
8commit d38e0e3fed4f58bcddef4dc93a591dfe2f651cb0 upstream.
9
10Commit 6bd4a5d96c08dc2380f8053b1bd4f879f55cd3c9 changed the
11ANDROID_ALARM_GET_TIME ioctls from IOW to IOR. While technically
12correct, the _IOC_DIR bits are ignored by alarm_ioctl, so the
13commit breaks a userspace ABI used by all existing Android devices
14for a purely cosmetic reason. Revert it.
15
16Cc: Dae S. Kim <dae@velatum.com>
17Signed-off-by: Colin Cross <ccross@android.com>
18Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20---
21 drivers/staging/android/android_alarm.h | 4 +---
22 1 file changed, 1 insertion(+), 3 deletions(-)
23
24--- a/drivers/staging/android/android_alarm.h
25+++ b/drivers/staging/android/android_alarm.h
26@@ -51,12 +51,10 @@ enum android_alarm_return_flags {
27 #define ANDROID_ALARM_WAIT _IO('a', 1)
28
29 #define ALARM_IOW(c, type, size) _IOW('a', (c) | ((type) << 4), size)
30-#define ALARM_IOR(c, type, size) _IOR('a', (c) | ((type) << 4), size)
31-
32 /* Set alarm */
33 #define ANDROID_ALARM_SET(type) ALARM_IOW(2, type, struct timespec)
34 #define ANDROID_ALARM_SET_AND_WAIT(type) ALARM_IOW(3, type, struct timespec)
35-#define ANDROID_ALARM_GET_TIME(type) ALARM_IOR(4, type, struct timespec)
36+#define ANDROID_ALARM_GET_TIME(type) ALARM_IOW(4, type, struct timespec)
37 #define ANDROID_ALARM_SET_RTC _IOW('a', 5, struct timespec)
38 #define ANDROID_ALARM_BASE_CMD(cmd) (cmd & ~(_IOC(0, 0, 0xf0, 0)))
39 #define ANDROID_ALARM_IOCTL_TO_TYPE(cmd) (_IOC_NR(cmd) >> 4)