Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern - remove #ifdef __FreeBSD__



details:   https://anonhg.NetBSD.org/src/rev/9cb2ef97f3d4
branches:  trunk
changeset: 972477:9cb2ef97f3d4
user:      rin <rin%NetBSD.org@localhost>
date:      Wed May 27 09:09:50 2020 +0000

description:
- remove #ifdef __FreeBSD__
- return (x) --> return x

No binary changes this time, trust me ;).

diffstat:

 sys/kern/kern_tc.c |  47 +++++++++++++++++++++--------------------------
 1 files changed, 21 insertions(+), 26 deletions(-)

diffs (142 lines):

diff -r a87ff102324b -r 9cb2ef97f3d4 sys/kern/kern_tc.c
--- a/sys/kern/kern_tc.c        Wed May 27 08:55:18 2020 +0000
+++ b/sys/kern/kern_tc.c        Wed May 27 09:09:50 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_tc.c,v 1.58 2020/05/27 08:55:18 rin Exp $ */
+/* $NetBSD: kern_tc.c,v 1.59 2020/05/27 09:09:50 rin Exp $ */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 
 #include <sys/cdefs.h>
 /* __FBSDID("$FreeBSD: src/sys/kern/kern_tc.c,v 1.166 2005/09/19 22:16:31 andre Exp $"); */
-__KERNEL_RCSID(0, "$NetBSD: kern_tc.c,v 1.58 2020/05/27 08:55:18 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_tc.c,v 1.59 2020/05/27 09:09:50 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ntp.h"
@@ -80,7 +80,7 @@
 {
        static u_int now;
 
-       return (++now);
+       return ++now;
 }
 
 static struct timecounter dummy_timecounter = {
@@ -143,11 +143,6 @@
 static volatile int timecounter_removals = 1;
 static u_int timecounter_bad;
 
-#ifdef __FreeBSD__
-SYSCTL_INT(_kern_timecounter, OID_AUTO, stepwarnings, CTLFLAG_RW,
-    &timestepwarnings, 0, "");
-#endif /* __FreeBSD__ */
-
 /*
  * sysctl helper routine for kern.timercounter.hardware
  */
@@ -177,7 +172,7 @@
        if (l != NULL && (error = kauth_authorize_system(l->l_cred, 
            KAUTH_SYSTEM_TIME, KAUTH_REQ_SYSTEM_TIME_TIMECOUNTERS, newname,
            NULL, NULL)) != 0)
-               return (error);
+               return error;
 
        if (!cold)
                mutex_spin_enter(&timecounter_lock);
@@ -208,9 +203,9 @@
        int error, mods;
 
        if (newp != NULL)
-               return (EPERM);
+               return EPERM;
        if (namelen != 0)
-               return (EINVAL);
+               return EINVAL;
 
        mutex_spin_enter(&timecounter_lock);
  retry:
@@ -244,7 +239,7 @@
        mutex_spin_exit(&timecounter_lock);
 
        *oldlenp = needed;
-       return (error);
+       return error;
 }
 
 SYSCTL_SETUP(sysctl_timecounter_setup, "sysctl timecounter setup")
@@ -310,8 +305,8 @@
        struct timecounter *tc;
 
        tc = th->th_counter;
-       return ((tc->tc_get_timecount(tc) - 
-                th->th_offset_count) & tc->tc_counter_mask);
+       return (tc->tc_get_timecount(tc) -
+                th->th_offset_count) & tc->tc_counter_mask;
 }
 
 /*
@@ -711,7 +706,7 @@
 tc_getfrequency(void)
 {
 
-       return (timehands->th_counter->tc_frequency);
+       return timehands->th_counter->tc_frequency;
 }
 
 /*
@@ -912,41 +907,41 @@
 
        switch (cmd) {
        case PPS_IOC_CREATE:
-               return (0);
+               return 0;
        case PPS_IOC_DESTROY:
-               return (0);
+               return 0;
        case PPS_IOC_SETPARAMS:
                app = (pps_params_t *)data;
                if (app->mode & ~pps->ppscap)
-                       return (EINVAL);
+                       return EINVAL;
                pps->ppsparam = *app;
-               return (0);
+               return 0;
        case PPS_IOC_GETPARAMS:
                app = (pps_params_t *)data;
                *app = pps->ppsparam;
                app->api_version = PPS_API_VERS_1;
-               return (0);
+               return 0;
        case PPS_IOC_GETCAP:
                *(int*)data = pps->ppscap;
-               return (0);
+               return 0;
        case PPS_IOC_FETCH:
                pipi = (pps_info_t *)data;
                pps->ppsinfo.current_mode = pps->ppsparam.mode;
                *pipi = pps->ppsinfo;
-               return (0);
+               return 0;
        case PPS_IOC_KCBIND:
 #ifdef PPS_SYNC
                epi = (int *)data;
                /* XXX Only root should be able to do this */
                if (*epi & ~pps->ppscap)
-                       return (EINVAL);
+                       return EINVAL;
                pps->kcmode = *epi;
-               return (0);
+               return 0;
 #else
-               return (EOPNOTSUPP);
+               return EOPNOTSUPP;
 #endif
        default:
-               return (EPASSTHROUGH);
+               return EPASSTHROUGH;
        }
 }
 



Home | Main Index | Thread Index | Old Index