diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2012-11-27 21:37:12 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-11-28 11:46:52 -0500 |
commit | 49b2746e1426ffa188421996a0323bdd47657108 (patch) | |
tree | 0e0aad3007ab701d763e74cbe2cc980db64aed76 | |
parent | a321846492f9ce3bab27f826e6579217fbc35732 (diff) |
staging/fwserial: Use WARN_ONCE when port table is corrupted
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/fwserial/fwserial.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c index 99a2d2dbd322..0681967337f9 100644 --- a/drivers/staging/fwserial/fwserial.c +++ b/drivers/staging/fwserial/fwserial.c | |||
@@ -939,14 +939,9 @@ static void fwserial_destroy(struct kref *kref) | |||
939 | 939 | ||
940 | mutex_lock(&port_table_lock); | 940 | mutex_lock(&port_table_lock); |
941 | for (j = 0; j < num_ports; ++i, ++j) { | 941 | for (j = 0; j < num_ports; ++i, ++j) { |
942 | static bool once; | 942 | port_table_corrupt |= port_table[i] != ports[j]; |
943 | int corrupt = port_table[i] != ports[j]; | 943 | WARN_ONCE(port_table_corrupt, "port_table[%d]: %p != ports[%d]: %p", |
944 | if (corrupt && !once) { | 944 | i, port_table[i], j, ports[j]); |
945 | WARN(corrupt, "port_table[%d]: %p != ports[%d]: %p", | ||
946 | i, port_table[i], j, ports[j]); | ||
947 | once = true; | ||
948 | port_table_corrupt = true; | ||
949 | } | ||
950 | 945 | ||
951 | port_table[i] = NULL; | 946 | port_table[i] = NULL; |
952 | } | 947 | } |