Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

11 views
Skip to first unread message

Joe

unread,
Jan 12, 2014, 9:30:01 AM1/12/14
to
---
drivers/staging/android/alarm-dev.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/android/alarm-dev.c b/drivers/staging/android/alarm-dev.c
index 647694f..87f2a02 100644
--- a/drivers/staging/android/alarm-dev.c
+++ b/drivers/staging/android/alarm-dev.c
@@ -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))
--
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Levente Kurusa

unread,
Jan 12, 2014, 10:40:02 AM1/12/14
to
Hello,

2014/1/12 Joe <cyborg...@gmail.com>:
> ---
> 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.

>
> diff --git a/drivers/staging/android/alarm-dev.c b/drivers/staging/android/alarm-dev.c
> index 647694f..87f2a02 100644
> --- a/drivers/staging/android/alarm-dev.c
> +++ b/drivers/staging/android/alarm-dev.c
> @@ -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?

> {
> - 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.

> [...]

--
Regards,
Levente Kurusa

Joe Borg

unread,
Jan 13, 2014, 3:20:02 PM1/13/14
to
Signed-off-by Joe Borg <cyborg...@gmail.com>
---
drivers/staging/android/alarm-dev.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/android/alarm-dev.c b/drivers/staging/android/alarm-dev.c
index 647694f..87f2a02 100644
--- a/drivers/staging/android/alarm-dev.c
+++ b/drivers/staging/android/alarm-dev.c
@@ -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))
--
1.8.5.2

Dan Carpenter

unread,
Jan 13, 2014, 3:40:02 PM1/13/14
to
On Mon, Jan 13, 2014 at 08:10:36PM +0000, Joe Borg wrote:
> Signed-off-by Joe Borg <cyborg...@gmail.com>
> ---
> drivers/staging/android/alarm-dev.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/android/alarm-dev.c b/drivers/staging/android/alarm-dev.c
> index 647694f..87f2a02 100644
> --- a/drivers/staging/android/alarm-dev.c
> +++ b/drivers/staging/android/alarm-dev.c
> @@ -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)

Levente already pointed out that this breaks the build. Really
Levente said was spot on and still applies to the v2 of the patch.

regards,
dan carpenter

Greg KH

unread,
Jan 13, 2014, 4:20:03 PM1/13/14
to
On Mon, Jan 13, 2014 at 08:10:36PM +0000, Joe Borg wrote:
> Signed-off-by Joe Borg <cyborg...@gmail.com>
> ---
> drivers/staging/android/alarm-dev.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/android/alarm-dev.c b/drivers/staging/android/alarm-dev.c
> index 647694f..87f2a02 100644
> --- a/drivers/staging/android/alarm-dev.c
> +++ b/drivers/staging/android/alarm-dev.c
> @@ -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)

Always build test your patches, this one wasn't.

> {
> - 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;

Why are you making this change? There is no logic change here at all.

> }
>
> -

Why remove this line?

Again, you are going to need changelog comments for any patch, please
redo them properly if you wish us to accept your patches.

thanks,

greg k-h
0 new messages