aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/android/alarm-dev.c
AgeCommit message (Collapse)Author
2013-06-04staging: alarm-dev: information leak in alarm_compat_ioctl()Dan Carpenter
If we pass an invalid clock type then "ts" is never set. We need to check for errors earlier, otherwise we end up passing uninitialized stack data to userspace. Reported-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-03staging: alarm-dev: information leak in alarm_ioctl()Dan Carpenter
Smatch complains that if we pass an invalid clock type then "ts" is never set. We need to check for errors earlier, otherwise we end up passing uninitialized stack data to userspace. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-18staging: alarm-dev: Implement compat_ioctl supportJohn Stultz
Implement compat_ioctl support for the alarm-dev ioctl. Cc: Serban Constantinescu <serban.constantinescu@arm.com> Cc: Arve Hjønnevåg <arve@android.com> Cc: Colin Cross <ccross@google.com> Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-18staging: alarm-dev: Refactor alarm-dev ioctl code in prep for compat_ioctlJohn Stultz
Cleanup the Android alarm-dev driver's ioctl code to refactor it in preparation for compat_ioctl support. Cc: Serban Constantinescu <serban.constantinescu@arm.com> Cc: Arve Hjønnevåg <arve@android.com> Cc: Colin Cross <ccross@google.com> Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-18staging: alarm-dev: Drop pre Android 1.0 _OLD ioctlsJohn Stultz
Per Colin's comment: "The "support old userspace code" comment for those two ioctls has been there since pre-Android 1.0. Those apis are not exposed to Android apps, I don't see any problem deleting them." Thus this patch removes the ANDROID_ALARM_SET_OLD and ANDROID_ALARM_SET_AND_WAIT_OLD ioctl compatability logic. Cc: Serban Constantinescu <serban.constantinescu@arm.com> Cc: Arve Hjønnevåg <arve@android.com> Cc: Colin Cross <ccross@google.com> Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04Staging: android: Alarm driver cleanupsDae S. Kim
Little cleanups. Enum value ANDROID_ALARM_TYPE_COUNT was treated as an alarm type within a switch statement. That condition was unreachable though. Signed-off-by: Dae S. Kim <dae@velatum.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-13staging: android: alarm: remove unnecessary goto statementDevendra Naga
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-12staging: Android: Fix NULL pointer related warning in alarm-dev.c fileSachin Kamat
Fixes the following sparse warning: drivers/staging/android/alarm-dev.c:259:35: warning: Using plain integer as NULL pointer Cc: Brian Swetland <swetland@google.com> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-04Staging: android: alarm: Rename pr_alarm to alarm_dbgJoe Perches
Rename a macro to make it explicit it's for debugging. Use %s: __func__ instead of embedding function names. Coalesce formats, align arguments. Signed-off-by: Joe Perches <joe@perches.com> Acked-by: David Rientjes <rientjes@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-24staging: android-alarm: Switch from wakelocks to wakeup sourcesJohn Stultz
In their current AOSP tree, the Android in-kernel wakelock infrastructure has been reimplemented in terms of wakeup sources: http://git.linaro.org/gitweb?p=people/jstultz/android.git;a=commitdiff;h=e9911f4efdc55af703b8b3bb8c839e6f5dd173bb The Android alarm driver currently has stubbed out calls to wakelock functionality. So this patch simply converts the stubbed out wakelock calls to wakeup source calls, and removes the empty wakelock macros Greg, would you mind queuing this in staging-next? CC: Colin Cross <ccross@android.com> CC: Arve Hjønnevåg <arve@android.com> CC: Greg KH <gregkh@linuxfoundation.org> CC: Android Kernel Team <kernel-team@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-20staging: android-alarm: Rework alarm-dev.c to use upstreamed alarmtimersJohn Stultz
This reworks the alarm-dev.c to use the upstreamed alarmtimers interface. CC: Colin Cross <ccross@android.com> CC: Thomas Gleixner <tglx@linutronix.de> CC: Android Kernel Team <kernel-team@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-20staging: android-alarm: Convert ALARM_ELAPSED_REALTIME to use CLOCK_BOOTTIMEJohn Stultz
The ALARM_ELAPSED_REALTIME clock domain in Android pointed to the need for something similar in linux system-wide (instead of limited to just the alarm interface). Thus CLOCK_BOOTTIME was introduced into the upstream kernel in 2.6.39. This patch attempts to convert the android alarm timer to utilize the kernel's CLOCK_BOOTTIME clockid for ALARM_ELAPSED_REALTIME, instead of managing it itself. CC: Colin Cross <ccross@android.com> CC: Thomas Gleixner <tglx@linutronix.de> CC: Android Kernel Team <kernel-team@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-18staging: Fix typo within android drivers.Masanari Iida
Fix spelling typo in comments within android drivers. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10staging: android-alarm: HACK: wakelock workaroundJohn Stultz
Allow Android alarmtimer device to build while wakelocks are still out of tree. CC: Arve Hjønnevåg <arve@android.com> CC: Android Kernel Team <kernel-team@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10staging: android-alarm: Fix namespace collision with upstreamed alarmtimersJohn Stultz
The upstreamed alarmtimers are similar but not quite 100% API compatibile with the android in-kernel alarm api. To aid the transition, prefix the the android in-kernel api with android_ CC: Arve Hjønnevåg <arve@android.com> CC: Android Kernel Team <kernel-team@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10staging: android-alarm: Fix include compile issuesJohn Stultz
The file asm/mach/time.h doesn't exist on all arches, so include <linux/time.h>. Also linux/sysdev.h is gone so kill it. CC: Arve Hjønnevåg <arve@android.com> CC: Android Kernel Team <kernel-team@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10staging: android-alarm: Add needed module.h includesAndy Green
Add module.h includes required to build CC: Arve Hjønnevåg <arve@android.com> CC: Android Kernel Team <kernel-team@android.com> CC: Andy Green <andy.green@linaro.org> Signed-off-by: Andy Green <andy.green@linaro.org> [jstultz: Tweaked commit subject, folded two patches into one] Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10staging: android-alarm: Add android alarm driver & in-kernel alarm interfaceArve Hjønnevåg
Drivers can now create alarms that will use an hrtimer while the system is running and the rtc to wake up from suspend. CC: Arve Hjønnevåg <arve@android.com> CC: Android Kernel Team <kernel-team@android.com> Signed-off-by: Arve Hjønnevåg <arve@android.com> [Fold and move alarm driver and interface to staging, fix whitespace issue, drop kconfig & make file changes as it currently doesn't build -jstultz] Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>