openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/util-linux/2.33.2-r0/util-linux-2.33.2/sys-utils/hwclock.c
static void calculate_adjustment(const struct hwclock_control* ctl,
                                 const double factor, const time_t last_time,
                                 const double not_adjusted,
                                 const time_t systime, struct timeval* tdrift_p)
{
    double exact_adjustment;

    exact_adjustment =
        ((double)(systime - last_time)) * factor / (24 * 60 * 60) +
        not_adjusted;
    tdrift_p->tv_sec = (time_t)floor(exact_adjustment);
    tdrift_p->tv_usec = (exact_adjustment - (double)tdrift_p->tv_sec) * 1E6;
    if (ctl->verbose)
    {
        printf(P_("Time since last adjustment is %ld second\n",
                  "Time since last adjustment is %ld seconds\n",
                  (systime - last_time)),
               (systime - last_time));
        printf(_("Calculated Hardware Clock drift is %ld.%06ld seconds\n"),
               tdrift_p->tv_sec, tdrift_p->tv_usec);
    }
}
/*
 * Calculate the drift correction currently needed for the
 * Hardware Clock based on the last time it was adjusted,
 * and the current drift factor, as stored in the adjtime file.
 *
 * The total drift adjustment needed is stored at tdrift_p.
 *
 */
Calculate the drift correction currently needed for the
Hardware Clock based on the last time it was adjusted,
and the current drift factor, as stored in the adjtime file.

The total drift adjustment needed is stored at tdrift_p.
Calculate the drift correction currently needed for the Hardware Clock based on the last time it was adjusted and the current drift factor as stored in the adjtime file . The total drift adjustment needed is stored at tdrift_p .
static void calculate_adjustment(const struct hwclock_control* ctl,
                                 const double factor, const time_t last_time,
                                 const double not_adjusted,
                                 const time_t systime, struct timeval* tdrift_p)
{
    double exact_adjustment;
    exact_adjustment =
        ((double)(systime - last_time)) * factor / (24 * 60 * 60) +
        not_adjusted;
    tdrift_p->tv_sec = (time_t)floor(exact_adjustment);
    tdrift_p->tv_usec = (exact_adjustment - (double)tdrift_p->tv_sec) * 1E6;
    if (ctl->verbose)
    {
        printf(P_("Time since last adjustment is %ld second\n",
                  "Time since last adjustment is %ld seconds\n",
                  (systime - last_time)),
               (systime - last_time));
        printf(_("Calculated Hardware Clock drift is %ld.%06ld seconds\n"),
               tdrift_p->tv_sec, tdrift_p->tv_usec);
    }
}
static void calculate_adjustment ( const struct hwclock_control * ctl , const double factor , const time_t last_time , const double not_adjusted , const time_t systime , struct timeval * tdrift_p ) { double exact_adjustment ; exact_adjustment = ( ( double ) ( systime - last_time ) ) * factor / ( 24 * 60 * 60 ) + not_adjusted ; tdrift_p -> tv_sec = ( time_t ) floor ( exact_adjustment ) ; tdrift_p -> tv_usec = ( exact_adjustment - ( double ) tdrift_p -> tv_sec ) * 1E6 ; if ( ctl -> verbose ) { printf ( P_ ( " \n " , " \n " , ( systime - last_time ) ) , ( systime - last_time ) ) ; printf ( _ ( " \n " ) , tdrift_p -> tv_sec , tdrift_p -> tv_usec ) ; } }
Calculate the drift correction currently needed for the
 Hardware Clock based on the last time it was adjusted,
 and the current drift factor, as stored in the adjtime file.
Calculate the drift correction currently needed for the Hardware Clock based on the last time it was adjusted and the current drift factor as stored in the adjtime file .