Tue Jun 13 00:42:27 2017 UTC ()
Move duplicate definition of SETBELL macro into wsbelldata.h.
(nat)
diff -r1.4 -r1.5 src/sys/dev/wscons/wsbell.c
diff -r1.1 -r1.2 src/sys/dev/wscons/wsbelldata.h
diff -r1.139 -r1.140 src/sys/dev/wscons/wskbd.c
--- src/sys/dev/wscons/wsbell.c 2017/06/12 07:12:49 1.4
+++ src/sys/dev/wscons/wsbell.c 2017/06/13 00:42:27 1.5
@@ -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>
@@ -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);
--- src/sys/dev/wscons/wsbelldata.h 2017/06/11 03:38:12 1.1
+++ src/sys/dev/wscons/wsbelldata.h 2017/06/13 00:42:27 1.2
@@ -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>
* All rights reserved.
@@ -34,6 +34,17 @@
#ifndef WSKBD_DEFAULT_BELL_VOLUME
#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,
--- src/sys/dev/wscons/wskbd.c 2017/06/11 03:38:12 1.139
+++ src/sys/dev/wscons/wskbd.c 2017/06/13 00:42:27 1.140
@@ -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);