Fix nxstyle warning

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2020-07-18 17:15:38 +08:00
committed by Brennan Ashton
parent e1ecb3e27c
commit 7c54f51dc0
3 changed files with 21 additions and 18 deletions
+7 -5
View File
@@ -168,7 +168,7 @@ static struct kinetis_lowerhalf_s g_rtc_lowerhalf =
#ifdef CONFIG_RTC_ALARM #ifdef CONFIG_RTC_ALARM
static void kinetis_alarm_callback(void) static void kinetis_alarm_callback(void)
{ {
FAR struct kinetis_cbinfo_s *cbinfo = &g_rtc_lowerhalf.cbinfo;/*[0];*/ FAR struct kinetis_cbinfo_s *cbinfo = &g_rtc_lowerhalf.cbinfo;
/* Sample and clear the callback information to minimize the window in /* Sample and clear the callback information to minimize the window in
* time in which race conditions can occur. * time in which race conditions can occur.
@@ -374,7 +374,8 @@ static int kinetis_setalarm(FAR struct rtc_lowerhalf_s *lower,
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_RTC_ALARM #ifdef CONFIG_RTC_ALARM
static int kinetis_setrelative(FAR struct rtc_lowerhalf_s *lower, static int
kinetis_setrelative(FAR struct rtc_lowerhalf_s *lower,
FAR const struct lower_setrelative_s *alarminfo) FAR const struct lower_setrelative_s *alarminfo)
{ {
struct lower_setalarm_s setalarm; struct lower_setalarm_s setalarm;
@@ -388,7 +389,7 @@ static int kinetis_setrelative(FAR struct rtc_lowerhalf_s *lower,
DEBUGASSERT(lower != NULL && alarminfo != NULL); DEBUGASSERT(lower != NULL && alarminfo != NULL);
DEBUGASSERT(alarminfo->id == RTC_ALARMA); DEBUGASSERT(alarminfo->id == RTC_ALARMA);
if ((alarminfo->id == RTC_ALARMA ) && if (alarminfo->id == RTC_ALARMA &&
alarminfo->reltime > 0) alarminfo->reltime > 0)
{ {
/* Disable pre-emption while we do this so that we don't have to worry /* Disable pre-emption while we do this so that we don't have to worry
@@ -419,6 +420,7 @@ static int kinetis_setrelative(FAR struct rtc_lowerhalf_s *lower,
return ret; return ret;
} }
#endif #endif
/* Convert to seconds since the epoch */ /* Convert to seconds since the epoch */
seconds = ts.tv_sec; seconds = ts.tv_sec;
@@ -466,7 +468,8 @@ static int kinetis_setrelative(FAR struct rtc_lowerhalf_s *lower,
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_RTC_ALARM #ifdef CONFIG_RTC_ALARM
static int kinetis_cancelalarm(FAR struct rtc_lowerhalf_s *lower, int alarmid) static int
kinetis_cancelalarm(FAR struct rtc_lowerhalf_s *lower, int alarmid)
{ {
FAR struct kinetis_lowerhalf_s *priv; FAR struct kinetis_lowerhalf_s *priv;
FAR struct kinetis_cbinfo_s *cbinfo; FAR struct kinetis_cbinfo_s *cbinfo;
@@ -489,7 +492,6 @@ static int kinetis_cancelalarm(FAR struct rtc_lowerhalf_s *lower, int alarmid)
/* Then cancel the alarm */ /* Then cancel the alarm */
ret = kinetis_rtc_cancelalarm(); ret = kinetis_rtc_cancelalarm();
} }
return ret; return ret;
@@ -615,8 +615,9 @@ static int max326_rdalarm(FAR struct rtc_lowerhalf_s *lower,
* Name: max326_periodic_callback * Name: max326_periodic_callback
* *
* Description: * Description:
* This is the function that is called from the RTC driver when the periodic * This is the function that is called from the RTC driver when the
* wakeup goes off. It just invokes the upper half drivers callback. * periodic wakeup goes off. It just invokes the upper half drivers
* callback.
* *
* Input Parameters: * Input Parameters:
* None * None
+4 -4
View File
@@ -273,14 +273,14 @@ static void clock_utc2calendar(time_t days, FAR int *year, FAR int *month,
} }
while (min < max); while (min < max);
/* The selected month number is in value. Subtract the number of days in the /* The selected month number is in value. Subtract the number of days in
* selected month * the selected month
*/ */
days -= clock_daysbeforemonth(value, leapyear); days -= clock_daysbeforemonth(value, leapyear);
/* At this point, value has the month into this year (zero based) and days has /* At this point, value has the month into this year (zero based) and days
* number of days into this month (zero based) * has number of days into this month (zero based)
*/ */
*month = value + 1; /* 1-based */ *month = value + 1; /* 1-based */