svn commit: r324768 - stable/11/sys/dev/evdev
Vladimir Kondratyev
wulf at FreeBSD.org
Thu Oct 19 20:16:42 UTC 2017
Author: wulf
Date: Thu Oct 19 20:16:40 2017
New Revision: 324768
URL: https://svnweb.freebsd.org/changeset/base/324768
Log:
MFC r321397-r321399
r321397:
evdev: style(9), sort headers alphabetically
r321398:
evdev: Macroize common locking sequences
r321399:
Change my email address to wulf at FreeBSD.org in copyright headers.
Approved by: gonzo (mentor)
Modified:
stable/11/sys/dev/evdev/cdev.c
stable/11/sys/dev/evdev/evdev.c
stable/11/sys/dev/evdev/evdev_mt.c
stable/11/sys/dev/evdev/evdev_private.h
stable/11/sys/dev/evdev/evdev_utils.c
stable/11/sys/dev/evdev/input-event-codes.h
stable/11/sys/dev/evdev/input.h
stable/11/sys/dev/evdev/uinput.c
stable/11/sys/dev/evdev/uinput.h
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/dev/evdev/cdev.c
==============================================================================
--- stable/11/sys/dev/evdev/cdev.c Thu Oct 19 18:04:16 2017 (r324767)
+++ stable/11/sys/dev/evdev/cdev.c Thu Oct 19 20:16:40 2017 (r324768)
@@ -1,6 +1,6 @@
/*-
* Copyright (c) 2014 Jakub Wojciech Klama <jceel at FreeBSD.org>
- * Copyright (c) 2015-2016 Vladimir Kondratyev <wulf at cicgroup.ru>
+ * Copyright (c) 2015-2016 Vladimir Kondratyev <wulf at FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,24 +29,23 @@
#include "opt_evdev.h"
-#include <sys/types.h>
-#include <sys/bitstring.h>
-#include <sys/systm.h>
#include <sys/param.h>
-#include <sys/kernel.h>
+#include <sys/bitstring.h>
#include <sys/conf.h>
-#include <sys/uio.h>
-#include <sys/proc.h>
-#include <sys/poll.h>
#include <sys/filio.h>
#include <sys/fcntl.h>
-#include <sys/selinfo.h>
+#include <sys/kernel.h>
#include <sys/malloc.h>
+#include <sys/poll.h>
+#include <sys/proc.h>
+#include <sys/selinfo.h>
+#include <sys/systm.h>
#include <sys/time.h>
+#include <sys/uio.h>
-#include <dev/evdev/input.h>
#include <dev/evdev/evdev.h>
#include <dev/evdev/evdev_private.h>
+#include <dev/evdev/input.h>
#ifdef EVDEV_DEBUG
#define debugf(client, fmt, args...) printf("evdev cdev: "fmt"\n", ##args)
Modified: stable/11/sys/dev/evdev/evdev.c
==============================================================================
--- stable/11/sys/dev/evdev/evdev.c Thu Oct 19 18:04:16 2017 (r324767)
+++ stable/11/sys/dev/evdev/evdev.c Thu Oct 19 20:16:40 2017 (r324768)
@@ -1,6 +1,6 @@
/*-
* Copyright (c) 2014 Jakub Wojciech Klama <jceel at FreeBSD.org>
- * Copyright (c) 2015-2016 Vladimir Kondratyev <wulf at cicgroup.ru>
+ * Copyright (c) 2015-2016 Vladimir Kondratyev <wulf at FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,19 +29,18 @@
#include "opt_evdev.h"
-#include <sys/types.h>
-#include <sys/systm.h>
#include <sys/param.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
+#include <sys/bitstring.h>
#include <sys/conf.h>
+#include <sys/kernel.h>
#include <sys/malloc.h>
-#include <sys/bitstring.h>
+#include <sys/module.h>
#include <sys/sysctl.h>
+#include <sys/systm.h>
-#include <dev/evdev/input.h>
#include <dev/evdev/evdev.h>
#include <dev/evdev/evdev_private.h>
+#include <dev/evdev/input.h>
#ifdef EVDEV_DEBUG
#define debugf(evdev, fmt, args...) printf("evdev: " fmt "\n", ##args)
@@ -758,14 +757,11 @@ evdev_push_event(struct evdev_dev *evdev, uint16_t typ
int32_t value)
{
- if (evdev->ev_lock_type != EV_LOCK_INTERNAL)
- EVDEV_LOCK_ASSERT(evdev);
-
if (evdev_check_event(evdev, type, code, value) != 0)
return (EINVAL);
- if (evdev->ev_lock_type == EV_LOCK_INTERNAL)
- EVDEV_LOCK(evdev);
+ EVDEV_ENTER(evdev);
+
evdev_modify_event(evdev, type, code, &value);
if (type == EV_SYN && code == SYN_REPORT &&
bit_test(evdev->ev_flags, EVDEV_FLAG_MT_AUTOREL))
@@ -774,8 +770,8 @@ evdev_push_event(struct evdev_dev *evdev, uint16_t typ
bit_test(evdev->ev_flags, EVDEV_FLAG_MT_STCOMPAT))
evdev_send_mt_compat(evdev);
evdev_send_event(evdev, type, code, value);
- if (evdev->ev_lock_type == EV_LOCK_INTERNAL)
- EVDEV_UNLOCK(evdev);
+
+ EVDEV_EXIT(evdev);
return (0);
}
Modified: stable/11/sys/dev/evdev/evdev_mt.c
==============================================================================
--- stable/11/sys/dev/evdev/evdev_mt.c Thu Oct 19 18:04:16 2017 (r324767)
+++ stable/11/sys/dev/evdev/evdev_mt.c Thu Oct 19 20:16:40 2017 (r324768)
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2016 Vladimir Kondratyev <wulf at cicgroup.ru>
+ * Copyright (c) 2016 Vladimir Kondratyev <wulf at FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -27,14 +27,14 @@
*/
#include <sys/param.h>
-#include <sys/malloc.h>
#include <sys/lock.h>
+#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/systm.h>
-#include <dev/evdev/input.h>
#include <dev/evdev/evdev.h>
#include <dev/evdev/evdev_private.h>
+#include <dev/evdev/input.h>
#ifdef DEBUG
#define debugf(fmt, args...) printf("evdev: " fmt "\n", ##args)
@@ -224,13 +224,9 @@ void
evdev_push_nfingers(struct evdev_dev *evdev, int32_t nfingers)
{
- if (evdev->ev_lock_type == EV_LOCK_INTERNAL)
- EVDEV_LOCK(evdev);
- else
- EVDEV_LOCK_ASSERT(evdev);
+ EVDEV_ENTER(evdev);
evdev_send_nfingers(evdev, nfingers);
- if (evdev->ev_lock_type == EV_LOCK_INTERNAL)
- EVDEV_UNLOCK(evdev);
+ EVDEV_EXIT(evdev);
}
void
@@ -264,13 +260,9 @@ void
evdev_push_mt_compat(struct evdev_dev *evdev)
{
- if (evdev->ev_lock_type == EV_LOCK_INTERNAL)
- EVDEV_LOCK(evdev);
- else
- EVDEV_LOCK_ASSERT(evdev);
+ EVDEV_ENTER(evdev);
evdev_send_mt_compat(evdev);
- if (evdev->ev_lock_type == EV_LOCK_INTERNAL)
- EVDEV_UNLOCK(evdev);
+ EVDEV_EXIT(evdev);
}
void
Modified: stable/11/sys/dev/evdev/evdev_private.h
==============================================================================
--- stable/11/sys/dev/evdev/evdev_private.h Thu Oct 19 18:04:16 2017 (r324767)
+++ stable/11/sys/dev/evdev/evdev_private.h Thu Oct 19 20:16:40 2017 (r324768)
@@ -1,6 +1,6 @@
/*-
* Copyright (c) 2014 Jakub Wojciech Klama <jceel at FreeBSD.org>
- * Copyright (c) 2015-2016 Vladimir Kondratyev <wulf at cicgroup.ru>
+ * Copyright (c) 2015-2016 Vladimir Kondratyev <wulf at FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -31,10 +31,11 @@
#define _DEV_EVDEV_EVDEV_PRIVATE_H
#include <sys/bitstring.h>
-#include <sys/queue.h>
-#include <sys/malloc.h>
#include <sys/kbio.h>
+#include <sys/malloc.h>
+#include <sys/queue.h>
#include <sys/selinfo.h>
+
#include <dev/evdev/evdev.h>
#include <dev/evdev/input.h>
#include <dev/kbd/kbdreg.h>
@@ -134,6 +135,16 @@ struct evdev_dev
#define EVDEV_LOCK(evdev) mtx_lock((evdev)->ev_lock)
#define EVDEV_UNLOCK(evdev) mtx_unlock((evdev)->ev_lock)
#define EVDEV_LOCK_ASSERT(evdev) mtx_assert((evdev)->ev_lock, MA_OWNED)
+#define EVDEV_ENTER(evdev) do { \
+ if ((evdev)->ev_lock_type == EV_LOCK_INTERNAL) \
+ EVDEV_LOCK(evdev); \
+ else \
+ EVDEV_LOCK_ASSERT(evdev); \
+} while (0)
+#define EVDEV_EXIT(evdev) do { \
+ if ((evdev)->ev_lock_type == EV_LOCK_INTERNAL) \
+ EVDEV_UNLOCK(evdev); \
+} while (0)
struct evdev_client
{
Modified: stable/11/sys/dev/evdev/evdev_utils.c
==============================================================================
--- stable/11/sys/dev/evdev/evdev_utils.c Thu Oct 19 18:04:16 2017 (r324767)
+++ stable/11/sys/dev/evdev/evdev_utils.c Thu Oct 19 20:16:40 2017 (r324768)
@@ -1,6 +1,6 @@
/*-
* Copyright (c) 2014 Jakub Wojciech Klama <jceel at FreeBSD.org>
- * Copyright (c) 2015-2016 Vladimir Kondratyev <wulf at cicgroup.ru>
+ * Copyright (c) 2015-2016 Vladimir Kondratyev <wulf at FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -27,17 +27,16 @@
* $FreeBSD$
*/
-#include <sys/types.h>
-#include <sys/systm.h>
#include <sys/param.h>
#include <sys/bus.h>
-#include <sys/kernel.h>
#include <sys/conf.h>
-#include <sys/malloc.h>
#include <sys/kbio.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/systm.h>
-#include <dev/evdev/input.h>
#include <dev/evdev/evdev.h>
+#include <dev/evdev/input.h>
#include <dev/kbd/kbdreg.h>
Modified: stable/11/sys/dev/evdev/input-event-codes.h
==============================================================================
--- stable/11/sys/dev/evdev/input-event-codes.h Thu Oct 19 18:04:16 2017 (r324767)
+++ stable/11/sys/dev/evdev/input-event-codes.h Thu Oct 19 20:16:40 2017 (r324768)
@@ -1,6 +1,6 @@
/*-
* Copyright (c) 2016 Oleksandr Tymoshenko <gonzo at FreeBSD.org>
- * Copyright (c) 2015-2016 Vladimir Kondratyev <wulf at cicgroup.ru>
+ * Copyright (c) 2015-2016 Vladimir Kondratyev <wulf at FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Modified: stable/11/sys/dev/evdev/input.h
==============================================================================
--- stable/11/sys/dev/evdev/input.h Thu Oct 19 18:04:16 2017 (r324767)
+++ stable/11/sys/dev/evdev/input.h Thu Oct 19 20:16:40 2017 (r324768)
@@ -1,6 +1,6 @@
/*-
* Copyright (c) 2016 Oleksandr Tymoshenko <gonzo at FreeBSD.org>
- * Copyright (c) 2015-2016 Vladimir Kondratyev <wulf at cicgroup.ru>
+ * Copyright (c) 2015-2016 Vladimir Kondratyev <wulf at FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -31,8 +31,8 @@
#define _EVDEV_INPUT_H
#ifndef __KERNEL__
-#include <sys/time.h>
#include <sys/ioccom.h>
+#include <sys/time.h>
#include <sys/types.h>
#endif
Modified: stable/11/sys/dev/evdev/uinput.c
==============================================================================
--- stable/11/sys/dev/evdev/uinput.c Thu Oct 19 18:04:16 2017 (r324767)
+++ stable/11/sys/dev/evdev/uinput.c Thu Oct 19 20:16:40 2017 (r324768)
@@ -1,6 +1,6 @@
/*-
* Copyright (c) 2014 Jakub Wojciech Klama <jceel at FreeBSD.org>
- * Copyright (c) 2015-2016 Vladimir Kondratyev <wulf at cicgroup.ru>
+ * Copyright (c) 2015-2016 Vladimir Kondratyev <wulf at FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,25 +29,24 @@
#include "opt_evdev.h"
-#include <sys/types.h>
-#include <sys/systm.h>
#include <sys/param.h>
+#include <sys/conf.h>
#include <sys/fcntl.h>
#include <sys/kernel.h>
+#include <sys/lock.h>
+#include <sys/malloc.h>
#include <sys/module.h>
-#include <sys/conf.h>
-#include <sys/uio.h>
-#include <sys/proc.h>
#include <sys/poll.h>
+#include <sys/proc.h>
#include <sys/selinfo.h>
-#include <sys/malloc.h>
-#include <sys/lock.h>
+#include <sys/systm.h>
#include <sys/sx.h>
+#include <sys/uio.h>
-#include <dev/evdev/input.h>
-#include <dev/evdev/uinput.h>
#include <dev/evdev/evdev.h>
#include <dev/evdev/evdev_private.h>
+#include <dev/evdev/input.h>
+#include <dev/evdev/uinput.h>
#ifdef UINPUT_DEBUG
#define debugf(state, fmt, args...) printf("uinput: " fmt "\n", ##args)
Modified: stable/11/sys/dev/evdev/uinput.h
==============================================================================
--- stable/11/sys/dev/evdev/uinput.h Thu Oct 19 18:04:16 2017 (r324767)
+++ stable/11/sys/dev/evdev/uinput.h Thu Oct 19 20:16:40 2017 (r324768)
@@ -1,6 +1,6 @@
/*-
* Copyright (c) 2016 Oleksandr Tymoshenko <gonzo at FreeBSD.org>
- * Copyright (c) 2015-2016 Vladimir Kondratyev <wulf at cicgroup.ru>
+ * Copyright (c) 2015-2016 Vladimir Kondratyev <wulf at FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
More information about the svn-src-stable-11
mailing list