Messages in this thread Patch in this message | | | From | Peter Hurley <> | Subject | [PATCH -next 2/3] staging/fwserial: Use WARN_ONCE when port table is corrupted | Date | Tue, 27 Nov 2012 21:37:12 -0500 |
| |
Signed-off-by: Peter Hurley <peter@hurleysoftware.com> --- drivers/staging/fwserial/fwserial.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c index 99a2d2d..0681967 100644 --- a/drivers/staging/fwserial/fwserial.c +++ b/drivers/staging/fwserial/fwserial.c @@ -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; } -- 1.8.0
| |