lkml.org 
[lkml]   [2012]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH -next 2/3] staging/fwserial: Use WARN_ONCE when port table is corrupted
Date

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


\
 
 \ /
  Last update: 2012-11-28 04:21    [W:0.070 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site