Commit 8a7245ea authored by Joe Perches's avatar Joe Perches Committed by Greg Kroah-Hartman

Staging: android: alarm: Rename pr_alarm to alarm_dbg

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: default avatarJoe Perches <joe@perches.com>
Acked-by: default avatarDavid Rientjes <rientjes@google.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5d3b0d18
...@@ -29,16 +29,14 @@ ...@@ -29,16 +29,14 @@
#define ANDROID_ALARM_PRINT_IO (1U << 1) #define ANDROID_ALARM_PRINT_IO (1U << 1)
#define ANDROID_ALARM_PRINT_INT (1U << 2) #define ANDROID_ALARM_PRINT_INT (1U << 2)
static int debug_mask = ANDROID_ALARM_PRINT_INFO; static int debug_mask = ANDROID_ALARM_PRINT_INFO;
module_param_named(debug_mask, debug_mask, int, S_IRUGO | S_IWUSR | S_IWGRP); module_param_named(debug_mask, debug_mask, int, S_IRUGO | S_IWUSR | S_IWGRP);
#define pr_alarm(debug_level_mask, args...) \ #define alarm_dbg(debug_level_mask, fmt, ...) \
do { \ do { \
if (debug_mask & ANDROID_ALARM_PRINT_##debug_level_mask) { \ if (debug_mask & ANDROID_ALARM_PRINT_##debug_level_mask) \
pr_info(args); \ pr_info(fmt, ##__VA_ARGS__); \
} \ } while (0)
} while (0)
#define ANDROID_ALARM_WAKEUP_MASK ( \ #define ANDROID_ALARM_WAKEUP_MASK ( \
ANDROID_ALARM_RTC_WAKEUP_MASK | \ ANDROID_ALARM_RTC_WAKEUP_MASK | \
...@@ -138,7 +136,7 @@ static long alarm_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -138,7 +136,7 @@ static long alarm_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
switch (ANDROID_ALARM_BASE_CMD(cmd)) { switch (ANDROID_ALARM_BASE_CMD(cmd)) {
case ANDROID_ALARM_CLEAR(0): case ANDROID_ALARM_CLEAR(0):
spin_lock_irqsave(&alarm_slock, flags); spin_lock_irqsave(&alarm_slock, flags);
pr_alarm(IO, "alarm %d clear\n", alarm_type); alarm_dbg(IO, "alarm %d clear\n", alarm_type);
devalarm_try_to_cancel(&alarms[alarm_type]); devalarm_try_to_cancel(&alarms[alarm_type]);
if (alarm_pending) { if (alarm_pending) {
alarm_pending &= ~alarm_type_mask; alarm_pending &= ~alarm_type_mask;
...@@ -167,7 +165,8 @@ static long alarm_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -167,7 +165,8 @@ static long alarm_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
} }
from_old_alarm_set: from_old_alarm_set:
spin_lock_irqsave(&alarm_slock, flags); spin_lock_irqsave(&alarm_slock, flags);
pr_alarm(IO, "alarm %d set %ld.%09ld\n", alarm_type, alarm_dbg(IO, "alarm %d set %ld.%09ld\n",
alarm_type,
new_alarm_time.tv_sec, new_alarm_time.tv_nsec); new_alarm_time.tv_sec, new_alarm_time.tv_nsec);
alarm_enabled |= alarm_type_mask; alarm_enabled |= alarm_type_mask;
devalarm_start(&alarms[alarm_type], devalarm_start(&alarms[alarm_type],
...@@ -179,7 +178,7 @@ static long alarm_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -179,7 +178,7 @@ static long alarm_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
/* fall though */ /* fall though */
case ANDROID_ALARM_WAIT: case ANDROID_ALARM_WAIT:
spin_lock_irqsave(&alarm_slock, flags); spin_lock_irqsave(&alarm_slock, flags);
pr_alarm(IO, "alarm wait\n"); alarm_dbg(IO, "alarm wait\n");
if (!alarm_pending && wait_pending) { if (!alarm_pending && wait_pending) {
__pm_relax(&alarm_wake_lock); __pm_relax(&alarm_wake_lock);
wait_pending = 0; wait_pending = 0;
...@@ -260,8 +259,9 @@ static int alarm_release(struct inode *inode, struct file *file) ...@@ -260,8 +259,9 @@ static int alarm_release(struct inode *inode, struct file *file)
for (i = 0; i < ANDROID_ALARM_TYPE_COUNT; i++) { for (i = 0; i < ANDROID_ALARM_TYPE_COUNT; i++) {
uint32_t alarm_type_mask = 1U << i; uint32_t alarm_type_mask = 1U << i;
if (alarm_enabled & alarm_type_mask) { if (alarm_enabled & alarm_type_mask) {
pr_alarm(INFO, "alarm_release: clear alarm, " alarm_dbg(INFO,
"pending %d\n", "%s: clear alarm, pending %d\n",
__func__,
!!(alarm_pending & alarm_type_mask)); !!(alarm_pending & alarm_type_mask));
alarm_enabled &= ~alarm_type_mask; alarm_enabled &= ~alarm_type_mask;
} }
...@@ -271,8 +271,8 @@ static int alarm_release(struct inode *inode, struct file *file) ...@@ -271,8 +271,8 @@ static int alarm_release(struct inode *inode, struct file *file)
} }
if (alarm_pending | wait_pending) { if (alarm_pending | wait_pending) {
if (alarm_pending) if (alarm_pending)
pr_alarm(INFO, "alarm_release: clear " alarm_dbg(INFO, "%s: clear pending alarms %x\n",
"pending alarms %x\n", alarm_pending); __func__, alarm_pending);
__pm_relax(&alarm_wake_lock); __pm_relax(&alarm_wake_lock);
wait_pending = 0; wait_pending = 0;
alarm_pending = 0; alarm_pending = 0;
...@@ -288,7 +288,7 @@ static void devalarm_triggered(struct devalarm *alarm) ...@@ -288,7 +288,7 @@ static void devalarm_triggered(struct devalarm *alarm)
unsigned long flags; unsigned long flags;
uint32_t alarm_type_mask = 1U << alarm->type; uint32_t alarm_type_mask = 1U << alarm->type;
pr_alarm(INT, "devalarm_triggered type %d\n", alarm->type); alarm_dbg(INT, "%s: type %d\n", __func__, alarm->type);
spin_lock_irqsave(&alarm_slock, flags); spin_lock_irqsave(&alarm_slock, flags);
if (alarm_enabled & alarm_type_mask) { if (alarm_enabled & alarm_type_mask) {
__pm_wakeup_event(&alarm_wake_lock, 5000); /* 5secs */ __pm_wakeup_event(&alarm_wake_lock, 5000); /* 5secs */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment