reformat clock_adjtime with always-true condition removed
authorRich Felker <dalias@aerifal.cx>
Wed, 3 Jun 2020 00:21:48 +0000 (20:21 -0400)
committerRich Felker <dalias@aerifal.cx>
Wed, 3 Jun 2020 00:21:48 +0000 (20:21 -0400)
src/linux/clock_adjtime.c

index 94521bfcbb39f26430d14d624de06e50c741d273..d4d03d24df401b7cbb0eac4ad163d43e90252346 100644 (file)
@@ -38,54 +38,52 @@ int clock_adjtime (clockid_t clock_id, struct timex *utx)
 {
        int r = -ENOSYS;
 #ifdef SYS_clock_adjtime64
-       if (1) {
-               struct ktimex64 ktx = {
-                       .modes = utx->modes,
-                       .offset = utx->offset,
-                       .freq = utx->freq,
-                       .maxerror = utx->maxerror,
-                       .esterror = utx->esterror,
-                       .status = utx->status,
-                       .constant = utx->constant,
-                       .precision = utx->precision,
-                       .tolerance = utx->tolerance,
-                       .time_sec = utx->time.tv_sec,
-                       .time_usec = utx->time.tv_usec,
-                       .tick = utx->tick,
-                       .ppsfreq = utx->ppsfreq,
-                       .jitter = utx->jitter,
-                       .shift = utx->shift,
-                       .stabil = utx->stabil,
-                       .jitcnt = utx->jitcnt,
-                       .calcnt = utx->calcnt,
-                       .errcnt = utx->errcnt,
-                       .stbcnt = utx->stbcnt,
-                       .tai = utx->tai,
-               };
-               r = __syscall(SYS_clock_adjtime64, clock_id, &ktx);
-               if (r>=0) {
-                       utx->modes = ktx.modes;
-                       utx->offset = ktx.offset;
-                       utx->freq = ktx.freq;
-                       utx->maxerror = ktx.maxerror;
-                       utx->esterror = ktx.esterror;
-                       utx->status = ktx.status;
-                       utx->constant = ktx.constant;
-                       utx->precision = ktx.precision;
-                       utx->tolerance = ktx.tolerance;
-                       utx->time.tv_sec = ktx.time_sec;
-                       utx->time.tv_usec = ktx.time_usec;
-                       utx->tick = ktx.tick;
-                       utx->ppsfreq = ktx.ppsfreq;
-                       utx->jitter = ktx.jitter;
-                       utx->shift = ktx.shift;
-                       utx->stabil = ktx.stabil;
-                       utx->jitcnt = ktx.jitcnt;
-                       utx->calcnt = ktx.calcnt;
-                       utx->errcnt = ktx.errcnt;
-                       utx->stbcnt = ktx.stbcnt;
-                       utx->tai = ktx.tai;
-               }
+       struct ktimex64 ktx = {
+               .modes = utx->modes,
+               .offset = utx->offset,
+               .freq = utx->freq,
+               .maxerror = utx->maxerror,
+               .esterror = utx->esterror,
+               .status = utx->status,
+               .constant = utx->constant,
+               .precision = utx->precision,
+               .tolerance = utx->tolerance,
+               .time_sec = utx->time.tv_sec,
+               .time_usec = utx->time.tv_usec,
+               .tick = utx->tick,
+               .ppsfreq = utx->ppsfreq,
+               .jitter = utx->jitter,
+               .shift = utx->shift,
+               .stabil = utx->stabil,
+               .jitcnt = utx->jitcnt,
+               .calcnt = utx->calcnt,
+               .errcnt = utx->errcnt,
+               .stbcnt = utx->stbcnt,
+               .tai = utx->tai,
+       };
+       r = __syscall(SYS_clock_adjtime64, clock_id, &ktx);
+       if (r>=0) {
+               utx->modes = ktx.modes;
+               utx->offset = ktx.offset;
+               utx->freq = ktx.freq;
+               utx->maxerror = ktx.maxerror;
+               utx->esterror = ktx.esterror;
+               utx->status = ktx.status;
+               utx->constant = ktx.constant;
+               utx->precision = ktx.precision;
+               utx->tolerance = ktx.tolerance;
+               utx->time.tv_sec = ktx.time_sec;
+               utx->time.tv_usec = ktx.time_usec;
+               utx->tick = ktx.tick;
+               utx->ppsfreq = ktx.ppsfreq;
+               utx->jitter = ktx.jitter;
+               utx->shift = ktx.shift;
+               utx->stabil = ktx.stabil;
+               utx->jitcnt = ktx.jitcnt;
+               utx->calcnt = ktx.calcnt;
+               utx->errcnt = ktx.errcnt;
+               utx->stbcnt = ktx.stbcnt;
+               utx->tai = ktx.tai;
        }
        if (SYS_clock_adjtime == SYS_clock_adjtime64 || r!=-ENOSYS)
                return __syscall_ret(r);