diff options
Diffstat (limited to 'common/rtc.c')
-rw-r--r-- | common/rtc.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/common/rtc.c b/common/rtc.c index 670e86d707..e4292e9762 100644 --- a/common/rtc.c +++ b/common/rtc.c @@ -1,4 +1,4 @@ -/* Copyright 2017 The Chromium OS Authors. All rights reserved. +/* Copyright 2017 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ @@ -8,9 +8,8 @@ #include "rtc.h" -static uint16_t days_since_year_start[12] = { - 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 -}; +static uint16_t days_since_year_start[12] = { 0, 31, 59, 90, 120, 151, + 181, 212, 243, 273, 304, 334 }; /* Conversion between calendar date and seconds eclapsed since 1970-01-01 */ uint32_t date_to_sec(struct calendar_date time) @@ -25,8 +24,8 @@ uint32_t date_to_sec(struct calendar_date time) } sec += (days_since_year_start[time.month - 1] + - (IS_LEAP_YEAR(time.year) && time.month > 2) + - (time.day - 1)) * SECS_PER_DAY; + (IS_LEAP_YEAR(time.year) && time.month > 2) + (time.day - 1)) * + SECS_PER_DAY; /* add the accumulated time in seconds from 1970 to 2000 */ return sec + SECS_TILL_YEAR_2K; @@ -55,7 +54,8 @@ struct calendar_date sec_to_date(uint32_t sec) } for (i = 1; i < 12; i++) { if (days_since_year_start[i] + - (IS_LEAP_YEAR(time.year) && (i >= 2)) >= day_tmp) + (IS_LEAP_YEAR(time.year) && (i >= 2)) >= + day_tmp) break; } time.month = i; |