Skip to contentSkip to conversation

AlarmDev: Changing is_wakeup() to be a function to pass checkpatch

PATCH In review Joe 2 participants 2 messages Jan 12, 2014 Staging

lore
Share & tools
lore

Joe

author
#0 lore raw

PATCH 1/1 AlarmDev: Changing is_wakeup() to be a function to pass checkpatch

---
 drivers/staging/android/alarm-dev.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/staging/android/alarm-dev.c +6 -4
index 647694f..87f2a02 100644
@@ -66,13 +66,15 @@ static struct devalarm alarms[ANDROID_ALARM_TYPE_COUNT];
  *
  * Return: 1 if this is a wakeup alarm, otherwise 0
  */
-static int is_wakeup(enum android_alarm_type type)
+static int is_wakeup(enum andriod_alarm_type type)
 {
-	return (type == ANDROID_ALARM_RTC_WAKEUP ||
-		type == ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP);
+	if (type == ANDROID_ALARM_RTC_WAKEUP ||
+	    type == ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP)
+		return 1;
+	else
+		return 0;
 }
 
-
 static void devalarm_start(struct devalarm *alrm, ktime_t exp)
 {
 	if (is_wakeup(alrm->type))
Signature · 1 line
1.8.3.2
#1 lore raw

Hello,

2014/1/12 Joe <[email protected]>:

Quoted 3 lines
---
 drivers/staging/android/alarm-dev.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

You are missing a commit message. Your subject as well looks a bit weird.

drivers/staging/android/alarm-dev.c static struct devalarm alarms[ANDROID_ALARM_TYPE_COUNT]; · line 69

Quoted 11 lines
drivers/staging/android/alarm-dev.c +1 -1
index 647694f..87f2a02 100644
@@ -66,13 +66,15 @@ static struct devalarm alarms[ANDROID_ALARM_TYPE_COUNT];
  *
  * Return: 1 if this is a wakeup alarm, otherwise 0
  */
-static int is_wakeup(enum android_alarm_type type)
+static int is_wakeup(enum andriod_alarm_type type)

What is this? andriod? Did it compile?

drivers/staging/android/alarm-dev.c static struct devalarm alarms[ANDROID_ALARM_TYPE_COUNT]; · line 75

Quoted 8 lines
drivers/staging/android/alarm-dev.c +5 -2
 {
-       return (type == ANDROID_ALARM_RTC_WAKEUP ||
-               type == ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP);
+       if (type == ANDROID_ALARM_RTC_WAKEUP ||
+           type == ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP)
+               return 1;
+       else
+               return 0;

While this is correct, the better fix would be to remove the parentheses..

Also, I think a similar patch was already applied, not sure though.

Quoted 1 line

[...]

--
Regards,
Levente Kurusa