Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci/hdaudio move debugging code inside debugging ifdef.
details: https://anonhg.NetBSD.org/src/rev/13fe2ec83693
branches: trunk
changeset: 790529:13fe2ec83693
user: christos <christos%NetBSD.org@localhost>
date: Wed Oct 16 18:13:00 2013 +0000
description:
move debugging code inside debugging ifdef.
diffstat:
sys/dev/pci/hdaudio/hdafg.c | 25 ++++++++++++++-----------
sys/dev/pci/hdaudio/hdaudio.c | 11 +++++------
2 files changed, 19 insertions(+), 17 deletions(-)
diffs (135 lines):
diff -r 680e56cae027 -r 13fe2ec83693 sys/dev/pci/hdaudio/hdafg.c
--- a/sys/dev/pci/hdaudio/hdafg.c Wed Oct 16 18:07:56 2013 +0000
+++ b/sys/dev/pci/hdaudio/hdafg.c Wed Oct 16 18:13:00 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.17 2013/10/16 17:43:33 christos Exp $ */
+/* $NetBSD: hdafg.c,v 1.18 2013/10/16 18:13:00 christos Exp $ */
/*
* Copyright (c) 2009 Precedence Technologies Ltd <support%precedence.co.uk@localhost>
@@ -60,7 +60,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.17 2013/10/16 17:43:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.18 2013/10/16 18:13:00 christos Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -532,7 +532,7 @@
hdafg_widget_pin_dump(struct hdafg_softc *sc)
{
struct hdaudio_widget *w;
- int i, conn, color, defdev;
+ int i, conn;
for (i = sc->sc_startnode; i < sc->sc_endnode; i++) {
w = hdafg_widget_lookup(sc, i);
@@ -541,14 +541,16 @@
if (w->w_type != COP_AWCAP_TYPE_PIN_COMPLEX)
continue;
conn = COP_CFG_PORT_CONNECTIVITY(w->w_pin.config);
- color = COP_CFG_COLOR(w->w_pin.config);
- defdev = COP_CFG_DEFAULT_DEVICE(w->w_pin.config);
if (conn != 1) {
+#ifdef HDAUDIO_DEBUG
+ int color = COP_CFG_COLOR(w->w_pin.config);
+ int defdev = COP_CFG_DEFAULT_DEVICE(w->w_pin.config);
hda_trace(sc, "io %02X: %s (%s, %s)\n",
w->w_nid,
hdafg_default_device[defdev],
hdafg_color[color],
hdafg_port_connectivity[conn]);
+#endif
}
}
}
@@ -975,7 +977,7 @@
{
struct hdaudio_assoc *as = sc->sc_assocs;
struct hdaudio_widget *w;
- uint32_t conn, color, defdev, curdev, curport;
+ uint32_t conn, defdev, curdev, curport;
int maxassocs = sc->sc_nassocs;
int i, j;
@@ -1053,7 +1055,6 @@
if (w == NULL)
continue;
conn = COP_CFG_PORT_CONNECTIVITY(w->w_pin.config);
- color = COP_CFG_COLOR(w->w_pin.config);
defdev = COP_CFG_DEFAULT_DEVICE(w->w_pin.config);
if (conn != curport || defdev != curdev)
continue;
@@ -1063,8 +1064,12 @@
else
hda_trace1(sc, " ");
firstport = false;
+#ifdef HDAUDIO_DEBUG
+ int color =
+ COP_CFG_COLOR(w->w_pin.config);
hda_trace1(sc, "%s",
hdafg_color[color]);
+#endif
hda_trace1(sc, "(%02X)", w->w_nid);
}
hda_print1(sc, "]");
@@ -3199,10 +3204,8 @@
{
struct hdaudio_audiodev *ad = st->st_cookie;
int handled = 0;
-/*###3202 [cc] error: variable 'sts' set but not used [-Werror=unused-but-set-variable]%%%*/
- uint8_t sts;
-
- sts = hda_read1(ad->ad_sc->sc_host, HDAUDIO_SD_STS(st->st_shift));
+
+ (void)hda_read1(ad->ad_sc->sc_host, HDAUDIO_SD_STS(st->st_shift));
hda_write1(ad->ad_sc->sc_host, HDAUDIO_SD_STS(st->st_shift),
HDAUDIO_STS_DESE | HDAUDIO_STS_FIFOE | HDAUDIO_STS_BCIS);
diff -r 680e56cae027 -r 13fe2ec83693 sys/dev/pci/hdaudio/hdaudio.c
--- a/sys/dev/pci/hdaudio/hdaudio.c Wed Oct 16 18:07:56 2013 +0000
+++ b/sys/dev/pci/hdaudio/hdaudio.c Wed Oct 16 18:13:00 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio.c,v 1.18 2011/11/24 03:35:59 mrg Exp $ */
+/* $NetBSD: hdaudio.c,v 1.19 2013/10/16 18:13:00 christos Exp $ */
/*
* Copyright (c) 2009 Precedence Technologies Ltd <support%precedence.co.uk@localhost>
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.18 2011/11/24 03:35:59 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.19 2013/10/16 18:13:00 christos Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -694,9 +694,6 @@
static void
hdaudio_codec_attach(struct hdaudio_codec *co)
{
-#ifdef HDAUDIO_DEBUG
- struct hdaudio_softc *sc = co->co_host;
-#endif
struct hdaudio_function_group *fg;
uint32_t vid, rid, snc, fgrp;
int starting_node, num_nodes, nid;
@@ -705,7 +702,6 @@
return;
vid = hdaudio_command(co, 0, CORB_GET_PARAMETER, COP_VENDOR_ID);
- rid = hdaudio_command(co, 0, CORB_GET_PARAMETER, COP_REVISION_ID);
snc = hdaudio_command(co, 0, CORB_GET_PARAMETER,
COP_SUBORDINATE_NODE_COUNT);
@@ -714,6 +710,9 @@
return;
#ifdef HDAUDIO_DEBUG
+ struct hdaudio_softc *sc = co->co_host;
+ uint32_t rid = hdaudio_command(co, 0, CORB_GET_PARAMETER,
+ COP_REVISION_ID);
hda_print(sc, "Codec%02X: %04X:%04X HDA %d.%d rev %d stepping %d\n",
co->co_addr, vid >> 16, vid & 0xffff,
(rid >> 20) & 0xf, (rid >> 16) & 0xf,
Home |
Main Index |
Thread Index |
Old Index