aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorHelmut Schaa <helmut.schaa@googlemail.com>2010-11-04 15:38:56 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-11-15 13:26:00 -0500
commite2f8c8752b994026fc0ddb4bb29ca229b3e0c104 (patch)
tree4ebaf573ce33eb5002b454eb0d432ddef31d51e5 /drivers/net
parent2b23cdaa3b0e9567597563e5a7a5103ecda447f0 (diff)
rt2x00: Optimize rt2x00debug_dump_frame when frame dumping is not active
When rt2x00 is compiled with debugging but frame dumping is currently not active we can avoid the call to do_gettimeofday. Furthermore, frame dumping is not the default case, mark it as unlikely. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00debug.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00debug.c b/drivers/net/wireless/rt2x00/rt2x00debug.c
index fcdb6b0dc40f..8296a9d47bbd 100644
--- a/drivers/net/wireless/rt2x00/rt2x00debug.c
+++ b/drivers/net/wireless/rt2x00/rt2x00debug.c
@@ -162,11 +162,11 @@ void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev,
162 struct timeval timestamp; 162 struct timeval timestamp;
163 u32 data_len; 163 u32 data_len;
164 164
165 do_gettimeofday(&timestamp); 165 if (likely(!test_bit(FRAME_DUMP_FILE_OPEN, &intf->frame_dump_flags)))
166
167 if (!test_bit(FRAME_DUMP_FILE_OPEN, &intf->frame_dump_flags))
168 return; 166 return;
169 167
168 do_gettimeofday(&timestamp);
169
170 if (skb_queue_len(&intf->frame_dump_skbqueue) > 20) { 170 if (skb_queue_len(&intf->frame_dump_skbqueue) > 20) {
171 DEBUG(rt2x00dev, "txrx dump queue length exceeded.\n"); 171 DEBUG(rt2x00dev, "txrx dump queue length exceeded.\n");
172 return; 172 return;