staging/fwserial: Use WARN_ONCE when port table is corrupted
authorPeter Hurley <peter@hurleysoftware.com>
Wed, 28 Nov 2012 02:37:12 +0000 (21:37 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Nov 2012 16:46:52 +0000 (08:46 -0800)
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fwserial/fwserial.c

index 99a2d2d..0681967 100644 (file)
@@ -939,14 +939,9 @@ static void fwserial_destroy(struct kref *kref)
 
        mutex_lock(&port_table_lock);
        for (j = 0; j < num_ports; ++i, ++j) {
-               static bool once;
-               int corrupt = port_table[i] != ports[j];
-               if (corrupt && !once) {
-                       WARN(corrupt, "port_table[%d]: %p != ports[%d]: %p",
-                            i, port_table[i], j, ports[j]);
-                       once = true;
-                       port_table_corrupt = true;
-               }
+               port_table_corrupt |= port_table[i] != ports[j];
+               WARN_ONCE(port_table_corrupt, "port_table[%d]: %p != ports[%d]: %p",
+                    i, port_table[i], j, ports[j]);
 
                port_table[i] = NULL;
        }