From owner-svn-src-user@FreeBSD.ORG  Tue Jan 13 19:14:25 2015
Return-Path: <owner-svn-src-user@FreeBSD.ORG>
Delivered-To: svn-src-user@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 541062EA;
 Tue, 13 Jan 2015 19:14:25 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::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 355F4D68;
 Tue, 13 Jan 2015 19:14:25 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0DJEOiP071014;
 Tue, 13 Jan 2015 19:14:24 GMT (envelope-from dchagin@FreeBSD.org)
Received: (from dchagin@localhost)
 by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0DJEOr5071009;
 Tue, 13 Jan 2015 19:14:24 GMT (envelope-from dchagin@FreeBSD.org)
Message-Id: <201501131914.t0DJEOr5071009@svn.freebsd.org>
X-Authentication-Warning: svn.freebsd.org: dchagin set sender to
 dchagin@FreeBSD.org using -f
From: Dmitry Chagin <dchagin@FreeBSD.org>
Date: Tue, 13 Jan 2015 19:14:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r277144 - user/dchagin/lemul/sys/compat/linux
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.18-1
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 13 Jan 2015 19:14:25 -0000

Author: dchagin
Date: Tue Jan 13 19:14:23 2015
New Revision: 277144
URL: https://svnweb.freebsd.org/changeset/base/277144

Log:
  Delete the duplicate of linux_to_native_clockid() function.

Modified:
  user/dchagin/lemul/sys/compat/linux/linux_time.c
  user/dchagin/lemul/sys/compat/linux/linux_timer.c
  user/dchagin/lemul/sys/compat/linux/linux_timer.h

Modified: user/dchagin/lemul/sys/compat/linux/linux_time.c
==============================================================================
--- user/dchagin/lemul/sys/compat/linux/linux_time.c	Tue Jan 13 18:56:29 2015	(r277143)
+++ user/dchagin/lemul/sys/compat/linux/linux_time.c	Tue Jan 13 19:14:23 2015	(r277144)
@@ -119,8 +119,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)
@@ -151,7 +149,7 @@ linux_to_native_timespec(struct timespec
 	return (0);
 }
 
-static int
+int
 linux_to_native_clockid(clockid_t *n, clockid_t l)
 {
 

Modified: user/dchagin/lemul/sys/compat/linux/linux_timer.c
==============================================================================
--- user/dchagin/lemul/sys/compat/linux/linux_timer.c	Tue Jan 13 18:56:29 2015	(r277143)
+++ user/dchagin/lemul/sys/compat/linux/linux_timer.c	Tue Jan 13 19:14:23 2015	(r277144)
@@ -49,23 +49,6 @@ __FBSDID("$FreeBSD$");
 #endif
 #include <compat/linux/linux_timer.h>
 
-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: user/dchagin/lemul/sys/compat/linux/linux_timer.h
==============================================================================
--- user/dchagin/lemul/sys/compat/linux/linux_timer.h	Tue Jan 13 18:56:29 2015	(r277143)
+++ user/dchagin/lemul/sys/compat/linux/linux_timer.h	Tue Jan 13 19:14:23 2015	(r277144)
@@ -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 */