Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/wscons Move duplicate definition of SETBELL macro in...
details: https://anonhg.NetBSD.org/src/rev/786ce269c4f1
branches: trunk
changeset: 354344:786ce269c4f1
user: nat <nat%NetBSD.org@localhost>
date: Tue Jun 13 00:42:27 2017 +0000
description:
Move duplicate definition of SETBELL macro into wsbelldata.h.
diffstat:
sys/dev/wscons/wsbell.c | 15 ++-------------
sys/dev/wscons/wsbelldata.h | 13 ++++++++++++-
sys/dev/wscons/wskbd.c | 15 ++-------------
3 files changed, 16 insertions(+), 27 deletions(-)
diffs (99 lines):
diff -r f4561b7d6fd8 -r 786ce269c4f1 sys/dev/wscons/wsbell.c
--- a/sys/dev/wscons/wsbell.c Tue Jun 13 00:28:10 2017 +0000
+++ b/sys/dev/wscons/wsbell.c Tue Jun 13 00:42:27 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wsbell.c,v 1.4 2017/06/12 07:12:49 pgoyette Exp $ */
+/* $NetBSD: wsbell.c,v 1.5 2017/06/13 00:42:27 nat Exp $ */
/*-
* Copyright (c) 2017 Nathanial Sloss <nathanialsloss%yahoo.com.au@localhost>
@@ -107,7 +107,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsbell.c,v 1.4 2017/06/12 07:12:49 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsbell.c,v 1.5 2017/06/13 00:42:27 nat Exp $");
#if defined(_KERNEL_OPT)
#include "wsmux.h"
@@ -351,17 +351,6 @@
* Try the wsbell specific ioctls.
*/
switch (cmd) {
-#define SETBELL(dstp, srcp, dfltp) \
- do { \
- (dstp)->pitch = ((srcp)->which & WSKBD_BELL_DOPITCH) ? \
- (srcp)->pitch : (dfltp)->pitch; \
- (dstp)->period = ((srcp)->which & WSKBD_BELL_DOPERIOD) ? \
- (srcp)->period : (dfltp)->period; \
- (dstp)->volume = ((srcp)->which & WSKBD_BELL_DOVOLUME) ? \
- (srcp)->volume : (dfltp)->volume; \
- (dstp)->which = WSKBD_BELL_DOALL; \
- } while (0)
-
case WSKBDIO_SETBELL:
if ((flag & FWRITE) == 0)
return (EACCES);
diff -r f4561b7d6fd8 -r 786ce269c4f1 sys/dev/wscons/wsbelldata.h
--- a/sys/dev/wscons/wsbelldata.h Tue Jun 13 00:28:10 2017 +0000
+++ b/sys/dev/wscons/wsbelldata.h Tue Jun 13 00:42:27 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wsbelldata.h,v 1.1 2017/06/11 03:38:12 nat Exp $ */
+/* $NetBSD: wsbelldata.h,v 1.2 2017/06/13 00:42:27 nat Exp $ */
/*-
* Copyright (c) 2017 Nathanial Sloss <nathanialsloss%yahoo.com.au@localhost>
* All rights reserved.
@@ -35,6 +35,17 @@
#define WSKBD_DEFAULT_BELL_VOLUME 50 /* 50% volume */
#endif
+#define SETBELL(dstp, srcp, dfltp) \
+ do { \
+ (dstp)->pitch = ((srcp)->which & WSKBD_BELL_DOPITCH) ? \
+ (srcp)->pitch : (dfltp)->pitch; \
+ (dstp)->period = ((srcp)->which & WSKBD_BELL_DOPERIOD) ? \
+ (srcp)->period : (dfltp)->period; \
+ (dstp)->volume = ((srcp)->which & WSKBD_BELL_DOVOLUME) ? \
+ (srcp)->volume : (dfltp)->volume; \
+ (dstp)->which = WSKBD_BELL_DOALL; \
+ } while (0)
+
static struct wskbd_bell_data wskbd_default_bell_data = {
WSKBD_BELL_DOALL,
WSKBD_DEFAULT_BELL_PITCH,
diff -r f4561b7d6fd8 -r 786ce269c4f1 sys/dev/wscons/wskbd.c
--- a/sys/dev/wscons/wskbd.c Tue Jun 13 00:28:10 2017 +0000
+++ b/sys/dev/wscons/wskbd.c Tue Jun 13 00:42:27 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wskbd.c,v 1.139 2017/06/11 03:38:12 nat Exp $ */
+/* $NetBSD: wskbd.c,v 1.140 2017/06/13 00:42:27 nat Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@@ -105,7 +105,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wskbd.c,v 1.139 2017/06/11 03:38:12 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wskbd.c,v 1.140 2017/06/13 00:42:27 nat Exp $");
#ifdef _KERNEL_OPT
#include "opt_ddb.h"
@@ -1059,17 +1059,6 @@
int len, error;
switch (cmd) {
-#define SETBELL(dstp, srcp, dfltp) \
- do { \
- (dstp)->pitch = ((srcp)->which & WSKBD_BELL_DOPITCH) ? \
- (srcp)->pitch : (dfltp)->pitch; \
- (dstp)->period = ((srcp)->which & WSKBD_BELL_DOPERIOD) ? \
- (srcp)->period : (dfltp)->period; \
- (dstp)->volume = ((srcp)->which & WSKBD_BELL_DOVOLUME) ? \
- (srcp)->volume : (dfltp)->volume; \
- (dstp)->which = WSKBD_BELL_DOALL; \
- } while (0)
-
case WSKBDIO_BELL:
if ((flag & FWRITE) == 0)
return (EACCES);
Home |
Main Index |
Thread Index |
Old Index