From owner-svn-src-stable@freebsd.org Sat Jan 9 17:12:46 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF2FCA68C9D; Sat, 9 Jan 2016 17:12:46 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 977CA1F83; Sat, 9 Jan 2016 17:12:46 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09HCjOq054461; Sat, 9 Jan 2016 17:12:45 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09HCjh2054458; Sat, 9 Jan 2016 17:12:45 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091712.u09HCjh2054458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:12:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293566 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:12:47 -0000 Author: dchagin Date: Sat Jan 9 17:12:45 2016 New Revision: 293566 URL: https://svnweb.freebsd.org/changeset/base/293566 Log: MFC r283464: Delete the duplicate of linux_to_native_clockid() function. Modified: stable/10/sys/compat/linux/linux_time.c stable/10/sys/compat/linux/linux_timer.c stable/10/sys/compat/linux/linux_timer.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_time.c ============================================================================== --- stable/10/sys/compat/linux/linux_time.c Sat Jan 9 17:11:25 2016 (r293565) +++ stable/10/sys/compat/linux/linux_time.c Sat Jan 9 17:12:45 2016 (r293566) @@ -120,8 +120,6 @@ LIN_SDT_PROBE_DEFINE1(time, linux_clock_ LIN_SDT_PROBE_DEFINE1(time, linux_clock_nanosleep, unsupported_clockid, "int"); LIN_SDT_PROBE_DEFINE1(time, linux_clock_nanosleep, return, "int"); -static int linux_to_native_clockid(clockid_t *, clockid_t); - void native_to_linux_timespec(struct l_timespec *ltp, struct timespec *ntp) @@ -152,7 +150,7 @@ linux_to_native_timespec(struct timespec return (0); } -static int +int linux_to_native_clockid(clockid_t *n, clockid_t l) { Modified: stable/10/sys/compat/linux/linux_timer.c ============================================================================== --- stable/10/sys/compat/linux/linux_timer.c Sat Jan 9 17:11:25 2016 (r293565) +++ stable/10/sys/compat/linux/linux_timer.c Sat Jan 9 17:12:45 2016 (r293566) @@ -49,23 +49,6 @@ __FBSDID("$FreeBSD$"); #endif #include -static int -linux_convert_l_clockid(clockid_t *clock_id) -{ - - switch (*clock_id) { - case LINUX_CLOCK_REALTIME: - *clock_id = CLOCK_REALTIME; - break; - case LINUX_CLOCK_MONOTONIC: - *clock_id = CLOCK_MONOTONIC; - break; - default: - return (EINVAL); - } - - return (0); -} static int linux_convert_l_sigevent(struct l_sigevent *l_sig, struct sigevent *sig) @@ -106,6 +89,7 @@ linux_timer_create(struct thread *td, st { struct l_sigevent l_ev; struct sigevent ev, *evp; + clockid_t nwhich; int error, id; if (uap->evp == NULL) { @@ -119,10 +103,10 @@ linux_timer_create(struct thread *td, st return (error); evp = &ev; } - error = linux_convert_l_clockid(&uap->clock_id); + error = linux_to_native_clockid(&nwhich, uap->clock_id); if (error != 0) return (error); - error = kern_ktimer_create(td, uap->clock_id, evp, &id, -1); + error = kern_ktimer_create(td, nwhich, evp, &id, -1); if (error == 0) { error = copyout(&id, uap->timerid, sizeof(int)); if (error != 0) @@ -179,4 +163,3 @@ linux_timer_delete(struct thread *td, st return (kern_ktimer_delete(td, uap->timerid)); } - Modified: stable/10/sys/compat/linux/linux_timer.h ============================================================================== --- stable/10/sys/compat/linux/linux_timer.h Sat Jan 9 17:11:25 2016 (r293565) +++ stable/10/sys/compat/linux/linux_timer.h Sat Jan 9 17:12:45 2016 (r293566) @@ -115,5 +115,6 @@ void native_to_linux_timespec(struct l_t struct timespec *); int linux_to_native_timespec(struct timespec *, struct l_timespec *); +int linux_to_native_clockid(clockid_t *, clockid_t); #endif /* _LINUX_TIMER_H */