Skip to contentSkip to conversation

rtc-bfin: add missing "return 0" in new alarm func

PATCH In review Mike Frysinger 3 participants 5 messages Mar 18, 2011 – Mar 19, 2011 2 messages not in the archive Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc-bfin: add missing "return 0" in new alarm func

The new bfin_rtc_alarm_irq_enable function forgot to add a "return 0" to the end leading to the build warning:
drivers/rtc/rtc-bfin.c: In function 'bfin_rtc_alarm_irq_enable':
drivers/rtc/rtc-bfin.c:253: warning: control reaches end of non-void function

---
 drivers/rtc/rtc-bfin.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/rtc/rtc-bfin.c +2 -0
index 17971d9..0e61e2d 100644
@@ -276,6 +276,8 @@ static int bfin_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
 		bfin_rtc_int_set_alarm(rtc);
 	else
 		bfin_rtc_int_clear(~(RTC_ISTAT_ALARM | RTC_ISTAT_ALARM_DAY));
+
+	return 0;
 }
 
 static int bfin_rtc_read_time(struct device *dev, struct rtc_time *tm)
Signature · 1 line
1.7.4.1
#1 lore raw
Quoted 4 lines · Mike Frysinger

The new bfin_rtc_alarm_irq_enable function forgot to add a "return 0" to the end leading to the build warning:
drivers/rtc/rtc-bfin.c: In function 'bfin_rtc_alarm_irq_enable':
drivers/rtc/rtc-bfin.c:253: warning: control reaches end of non-void function

Hi Mike,
I am sure we should give a return-value
but whether it is '0'? Maybe it should return
other value.
Can you give some explanations for yours.

Thanks.
Best Regards.
Harry Wei.

Quoted 28 lines
---
 drivers/rtc/rtc-bfin.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/rtc/rtc-bfin.c +2 -0
index 17971d9..0e61e2d 100644
@@ -276,6 +276,8 @@ static int bfin_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
 		bfin_rtc_int_set_alarm(rtc);
 	else
 		bfin_rtc_int_clear(~(RTC_ISTAT_ALARM | RTC_ISTAT_ALARM_DAY));
+
+	return 0;
 }
 
 static int bfin_rtc_read_time(struct device *dev, struct rtc_time *tm)
Signature · 7 lines
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
#2 lore raw
Quoted 10 lines · Harry Wei
Quoted 4 lines · Mike Frysinger

The new bfin_rtc_alarm_irq_enable function forgot to add a "return 0" to the end leading to the build warning:
      drivers/rtc/rtc-bfin.c: In function 'bfin_rtc_alarm_irq_enable':
      drivers/rtc/rtc-bfin.c:253: warning: control reaches end of non-void function

  I am sure we should give a return-value
but whether it is '0'? Maybe it should return
other value.
  Can you give some explanations for yours.

read the interface.c code ... this func returns 0 on "success". i dont know what other possible value this could return. -mike

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

Acked-by
#5 lore raw

Re: [PATCH] rtc-bfin: add missing "return 0" in new alarm func> On Fri, Mar 18, 2011 at 04:26:24AM -0400, Mike Frysinger wrote:

	On Sat, Mar 19, 2011 at 09:10:14AM +0800, jiaweiwei wrote:
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

the end leading to the build warning:
drivers/rtc/rtc-bfin.c: In function 'bfin_rtc_alarm_irq_enable':
drivers/rtc/rtc-bfin.c:253: warning: control reaches end of
non-void function

Quoted 27 lines
Quoted 18 lines
Quoted 18 lines
---
 drivers/rtc/rtc-bfin.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/rtc/rtc-bfin.c +2 -0
index 17971d9..0e61e2d 100644
@@ -276,6 +276,8 @@ static int bfin_rtc_alarm_irq_enable(struct device
 *dev, unsigned int enabled)
               bfin_rtc_int_set_alarm(rtc);
       else
               bfin_rtc_int_clear(~(RTC_ISTAT_ALARM |
 RTC_ISTAT_ALARM_DAY));
+
+       return 0;
 }
Quoted 4 lines
Quoted 4 lines

static int bfin_rtc_read_time(struct device *dev, struct rtc_time *tm)
--
1.7.4.1

alarm_irq_enable function forgot to add a "return 0" to

Quoted 3 lines

the end leading to the build warning:
drivers/rtc/rtc-bfin.c: In function 'bfin_rtc_alarm_irq_enable':
drivers/rtc/rtc-bfin.c:253: warning: control reaches end of non-void function

Quoted 7 lines

I am sure we should give a return-value
but whether it is '0'? Maybe it should return
other value.
Can you give some explanations for yours.

read the interface.c code ... this func returns 0 on "success". i dont know what other possible value this could return.

Oh, it is true.

Thanks.
Best Regards.
Harry Wei.

Acked-by on v1 1/1
#6 lore raw
In reply to Mike Frysinger
Quoted 7 lines · Mike Frysinger

The new bfin_rtc_alarm_irq_enable function forgot to add a "return 0" to the end leading to the build warning:
drivers/rtc/rtc-bfin.c: In function 'bfin_rtc_alarm_irq_enable':
drivers/rtc/rtc-bfin.c:253: warning: control reaches end of non-void function

Thanks for catching this!