Module Name:    src
Committed By:   nat
Date:           Tue Jun 13 00:42:27 UTC 2017

Modified Files:
        src/sys/dev/wscons: wsbell.c wsbelldata.h wskbd.c

Log Message:
Move duplicate definition of SETBELL macro into wsbelldata.h.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/wscons/wsbell.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/wscons/wsbelldata.h
cvs rdiff -u -r1.139 -r1.140 src/sys/dev/wscons/wskbd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/wscons/wsbell.c
diff -u src/sys/dev/wscons/wsbell.c:1.4 src/sys/dev/wscons/wsbell.c:1.5
--- src/sys/dev/wscons/wsbell.c:1.4	Mon Jun 12 07:12:49 2017
+++ src/sys/dev/wscons/wsbell.c	Tue Jun 13 00:42:27 2017
@@ -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 <nathanialsl...@yahoo.com.au>
@@ -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 @@ wsbell_do_ioctl(struct wsbell_softc *sc,
 	 * 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);

Index: src/sys/dev/wscons/wsbelldata.h
diff -u src/sys/dev/wscons/wsbelldata.h:1.1 src/sys/dev/wscons/wsbelldata.h:1.2
--- src/sys/dev/wscons/wsbelldata.h:1.1	Sun Jun 11 03:38:12 2017
+++ src/sys/dev/wscons/wsbelldata.h	Tue Jun 13 00:42:27 2017
@@ -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 <nathanialsl...@yahoo.com.au>
  * 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,

Index: src/sys/dev/wscons/wskbd.c
diff -u src/sys/dev/wscons/wskbd.c:1.139 src/sys/dev/wscons/wskbd.c:1.140
--- src/sys/dev/wscons/wskbd.c:1.139	Sun Jun 11 03:38:12 2017
+++ src/sys/dev/wscons/wskbd.c	Tue Jun 13 00:42:27 2017
@@ -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 @@ wskbd_displayioctl(device_t dev, u_long 
 	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);

Reply via email to