Skip to contentSkip to conversation

mISDN: l1oip_core: replace _manual_ swap with swap macro

PATCH Applied Gustavo A. R. Silva 2 participants 2 messages Nov 3, 2017 – Nov 5, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mISDN: l1oip_core: replace _manual_ swap with swap macro

Make use of the swap macro and remove unnecessary variables skb and cnt. This makes the code easier to read and maintain.

This code was detected with the help of Coccinelle.

---
 drivers/isdn/mISDN/l1oip_core.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/isdn/mISDN/l1oip_core.c +2 -8
index b5d590e..e365478 100644
@@ -440,14 +440,8 @@ l1oip_socket_recv(struct l1oip *hc, u8 remotecodec, u8 channel, u16 timebase,
 
 #ifdef REORDER_DEBUG
 		if (hc->chan[channel].disorder_flag) {
-			struct sk_buff *skb;
-			int cnt;
-			skb = hc->chan[channel].disorder_skb;
-			hc->chan[channel].disorder_skb = nskb;
-			nskb = skb;
-			cnt = hc->chan[channel].disorder_cnt;
-			hc->chan[channel].disorder_cnt = rx_counter;
-			rx_counter = cnt;
+			swap(hc->chan[channel].disorder_skb, nskb);
+			swap(hc->chan[channel].disorder_cnt, rx_counter);
 		}
 		hc->chan[channel].disorder_flag ^= 1;
 		if (nskb)
Signature · 1 line
2.7.4
maintainer Applied
#1 lore raw

From: "Gustavo A. R. Silva" <[email protected]>
Date: Fri, 3 Nov 2017 11:52:45 -0500

Quoted 6 lines

Make use of the swap macro and remove unnecessary variables skb and cnt. This makes the code easier to read and maintain.

This code was detected with the help of Coccinelle.

Applied, thank you.