2015-04-23 12:26:00

by Krzysztof Kozłowski

[permalink] [raw]
Subject: [PATCH 1/2] rtc: interface: Fix coding style violations

Fix issues reported by checkpatch:
ERROR: open brace '{' following struct go on the same line
ERROR: "foo* bar" should be "foo *bar"

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
include/linux/rtc.h | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index c8b68741994e..85b48b29a143 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -101,8 +101,7 @@ struct rtc_timer {
/* flags */
#define RTC_DEV_BUSY 0

-struct rtc_device
-{
+struct rtc_device {
struct device dev;
struct module *owner;

@@ -202,10 +201,10 @@ int rtc_register(rtc_task_t *task);
int rtc_unregister(rtc_task_t *task);
int rtc_control(rtc_task_t *t, unsigned int cmd, unsigned long arg);

-void rtc_timer_init(struct rtc_timer *timer, void (*f)(void* p), void* data);
-int rtc_timer_start(struct rtc_device *rtc, struct rtc_timer* timer,
+void rtc_timer_init(struct rtc_timer *timer, void (*f)(void *p), void *data);
+int rtc_timer_start(struct rtc_device *rtc, struct rtc_timer *timer,
ktime_t expires, ktime_t period);
-int rtc_timer_cancel(struct rtc_device *rtc, struct rtc_timer* timer);
+int rtc_timer_cancel(struct rtc_device *rtc, struct rtc_timer *timer);
void rtc_timer_do_work(struct work_struct *work);

static inline bool is_leap_year(unsigned int year)
--
2.1.0


2015-04-23 12:26:05

by Krzysztof Kozłowski

[permalink] [raw]
Subject: [PATCH 2/2] rtc: interface: Remove unused return value from rtc_timer_cancel()

The rtc_timer_cancel() always returns 0 and cannot fail (calls only
other void-returning functions).

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/rtc/interface.c | 4 +---
include/linux/rtc.h | 2 +-
2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index 96268fc11337..31f11ab214a0 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -983,14 +983,12 @@ int rtc_timer_start(struct rtc_device *rtc, struct rtc_timer *timer,
*
* Kernel interface to cancel an rtc_timer
*/
-int rtc_timer_cancel(struct rtc_device *rtc, struct rtc_timer *timer)
+void rtc_timer_cancel(struct rtc_device *rtc, struct rtc_timer *timer)
{
- int ret = 0;
mutex_lock(&rtc->ops_lock);
if (timer->enabled)
rtc_timer_remove(rtc, timer);
mutex_unlock(&rtc->ops_lock);
- return ret;
}


diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index 85b48b29a143..381d12086ab3 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -204,7 +204,7 @@ int rtc_control(rtc_task_t *t, unsigned int cmd, unsigned long arg);
void rtc_timer_init(struct rtc_timer *timer, void (*f)(void *p), void *data);
int rtc_timer_start(struct rtc_device *rtc, struct rtc_timer *timer,
ktime_t expires, ktime_t period);
-int rtc_timer_cancel(struct rtc_device *rtc, struct rtc_timer *timer);
+void rtc_timer_cancel(struct rtc_device *rtc, struct rtc_timer *timer);
void rtc_timer_do_work(struct work_struct *work);

static inline bool is_leap_year(unsigned int year)
--
2.1.0

2015-05-03 09:40:09

by Alexandre Belloni

[permalink] [raw]
Subject: Re: [PATCH 1/2] rtc: interface: Fix coding style violations

Hi,

On 23/04/2015 at 21:25:39 +0900, Krzysztof Kozlowski wrote :
> Fix issues reported by checkpatch:
> ERROR: open brace '{' following struct go on the same line
> ERROR: "foo* bar" should be "foo *bar"
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> ---
> include/linux/rtc.h | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/include/linux/rtc.h b/include/linux/rtc.h
> index c8b68741994e..85b48b29a143 100644
> --- a/include/linux/rtc.h
> +++ b/include/linux/rtc.h
> @@ -101,8 +101,7 @@ struct rtc_timer {
> /* flags */
> #define RTC_DEV_BUSY 0
>
> -struct rtc_device
> -{
> +struct rtc_device {
> struct device dev;
> struct module *owner;
>
> @@ -202,10 +201,10 @@ int rtc_register(rtc_task_t *task);
> int rtc_unregister(rtc_task_t *task);
> int rtc_control(rtc_task_t *t, unsigned int cmd, unsigned long arg);
>
> -void rtc_timer_init(struct rtc_timer *timer, void (*f)(void* p), void* data);
> -int rtc_timer_start(struct rtc_device *rtc, struct rtc_timer* timer,
> +void rtc_timer_init(struct rtc_timer *timer, void (*f)(void *p), void *data);
> +int rtc_timer_start(struct rtc_device *rtc, struct rtc_timer *timer,
> ktime_t expires, ktime_t period);

While at it, alignment here should match the open parenthesis.

--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

2015-05-03 09:42:36

by Krzysztof Kozłowski

[permalink] [raw]
Subject: Re: [PATCH 1/2] rtc: interface: Fix coding style violations

2015-05-03 18:39 GMT+09:00 Alexandre Belloni
<[email protected]>:
> Hi,
>
> On 23/04/2015 at 21:25:39 +0900, Krzysztof Kozlowski wrote :
>> Fix issues reported by checkpatch:
>> ERROR: open brace '{' following struct go on the same line
>> ERROR: "foo* bar" should be "foo *bar"
>>
>> Signed-off-by: Krzysztof Kozlowski <[email protected]>
>> ---
>> include/linux/rtc.h | 9 ++++-----
>> 1 file changed, 4 insertions(+), 5 deletions(-)
>>
>> diff --git a/include/linux/rtc.h b/include/linux/rtc.h
>> index c8b68741994e..85b48b29a143 100644
>> --- a/include/linux/rtc.h
>> +++ b/include/linux/rtc.h
>> @@ -101,8 +101,7 @@ struct rtc_timer {
>> /* flags */
>> #define RTC_DEV_BUSY 0
>>
>> -struct rtc_device
>> -{
>> +struct rtc_device {
>> struct device dev;
>> struct module *owner;
>>
>> @@ -202,10 +201,10 @@ int rtc_register(rtc_task_t *task);
>> int rtc_unregister(rtc_task_t *task);
>> int rtc_control(rtc_task_t *t, unsigned int cmd, unsigned long arg);
>>
>> -void rtc_timer_init(struct rtc_timer *timer, void (*f)(void* p), void* data);
>> -int rtc_timer_start(struct rtc_device *rtc, struct rtc_timer* timer,
>> +void rtc_timer_init(struct rtc_timer *timer, void (*f)(void *p), void *data);
>> +int rtc_timer_start(struct rtc_device *rtc, struct rtc_timer *timer,
>> ktime_t expires, ktime_t period);
>
> While at it, alignment here should match the open parenthesis.

Sure, I'll respin.

Best regards,
Krzysztof