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

View File

@ -107,7 +107,7 @@ static int kinetis_settime(FAR struct rtc_lowerhalf_s *lower,
static int kinetis_setalarm(FAR struct rtc_lowerhalf_s *lower,
FAR const struct lower_setalarm_s *alarminfo);
static int kinetis_setrelative(FAR struct rtc_lowerhalf_s *lower,
FAR const struct lower_setrelative_s *alarminfo);
FAR const struct lower_setrelative_s *alarminfo);
static int kinetis_cancelalarm(FAR struct rtc_lowerhalf_s *lower,
int alarmid);
static int kinetis_rdalarm(FAR struct rtc_lowerhalf_s *lower,
@ -168,7 +168,7 @@ static struct kinetis_lowerhalf_s g_rtc_lowerhalf =
#ifdef CONFIG_RTC_ALARM
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
* time in which race conditions can occur.
@ -330,7 +330,7 @@ static int kinetis_setalarm(FAR struct rtc_lowerhalf_s *lower,
DEBUGASSERT(lower != NULL && alarminfo != NULL);
priv = (FAR struct kinetis_lowerhalf_s *)lower;
if (alarminfo->id == RTC_ALARMA )
if (alarminfo->id == RTC_ALARMA)
{
/* Remember the callback information */
@ -374,8 +374,9 @@ static int kinetis_setalarm(FAR struct rtc_lowerhalf_s *lower,
****************************************************************************/
#ifdef CONFIG_RTC_ALARM
static int kinetis_setrelative(FAR struct rtc_lowerhalf_s *lower,
FAR const struct lower_setrelative_s *alarminfo)
static int
kinetis_setrelative(FAR struct rtc_lowerhalf_s *lower,
FAR const struct lower_setrelative_s *alarminfo)
{
struct lower_setalarm_s setalarm;
#if defined(CONFIG_RTC_DATETIME)
@ -388,7 +389,7 @@ static int kinetis_setrelative(FAR struct rtc_lowerhalf_s *lower,
DEBUGASSERT(lower != NULL && alarminfo != NULL);
DEBUGASSERT(alarminfo->id == RTC_ALARMA);
if ((alarminfo->id == RTC_ALARMA ) &&
if (alarminfo->id == RTC_ALARMA &&
alarminfo->reltime > 0)
{
/* 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;
}
#endif
/* Convert to seconds since the epoch */
seconds = ts.tv_sec;
@ -466,7 +468,8 @@ static int kinetis_setrelative(FAR struct rtc_lowerhalf_s *lower,
****************************************************************************/
#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_cbinfo_s *cbinfo;
@ -489,7 +492,6 @@ static int kinetis_cancelalarm(FAR struct rtc_lowerhalf_s *lower, int alarmid)
/* Then cancel the alarm */
ret = kinetis_rtc_cancelalarm();
}
return ret;

View File

@ -119,7 +119,7 @@ static bool max326_havesettime(FAR struct rtc_lowerhalf_s *lower);
static int max326_setalarm(FAR struct rtc_lowerhalf_s *lower,
FAR const struct lower_setalarm_s *alarminfo);
static int max326_setrelative(FAR struct rtc_lowerhalf_s *lower,
FAR const struct lower_setrelative_s *alarminfo);
FAR const struct lower_setrelative_s *alarminfo);
static int max326_cancelalarm(FAR struct rtc_lowerhalf_s *lower,
int alarmid);
static int max326_rdalarm(FAR struct rtc_lowerhalf_s *lower,
@ -128,7 +128,7 @@ static int max326_rdalarm(FAR struct rtc_lowerhalf_s *lower,
#ifdef CONFIG_RTC_PERIODIC
static int max326_setperiodic(FAR struct rtc_lowerhalf_s *lower,
FAR const struct lower_setperiodic_s *alarminfo);
FAR const struct lower_setperiodic_s *alarminfo);
static int max326_cancelperiodic(FAR struct rtc_lowerhalf_s *lower, int id);
#endif
@ -598,9 +598,9 @@ static int max326_rdalarm(FAR struct rtc_lowerhalf_s *lower,
{
/* Extract integer seconds from the b32_t value */
time_t sec = (time_t)(b32toi(ftime));
time_t sec = (time_t)(b32toi(ftime));
/* Convert to struct rtc_time (aka struct tm) */
/* Convert to struct rtc_time (aka struct tm) */
localtime_r(&sec, (FAR struct tm *)alarminfo->time);
ret = OK;
@ -615,8 +615,9 @@ static int max326_rdalarm(FAR struct rtc_lowerhalf_s *lower,
* Name: max326_periodic_callback
*
* Description:
* This is the function that is called from the RTC driver when the periodic
* wakeup goes off. It just invokes the upper half drivers callback.
* This is the function that is called from the RTC driver when the
* periodic wakeup goes off. It just invokes the upper half drivers
* callback.
*
* Input Parameters:
* None

View File

@ -273,14 +273,14 @@ static void clock_utc2calendar(time_t days, FAR int *year, FAR int *month,
}
while (min < max);
/* The selected month number is in value. Subtract the number of days in the
* selected month
/* The selected month number is in value. Subtract the number of days in
* the selected month
*/
days -= clock_daysbeforemonth(value, leapyear);
/* At this point, value has the month into this year (zero based) and days has
* number of days into this month (zero based)
/* At this point, value has the month into this year (zero based) and days
* has number of days into this month (zero based)
*/
*month = value + 1; /* 1-based */