Skip to content

Commit

Permalink
mISDN: l1oip_core: replace _manual_ swap with swap macro
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
GustavoARSilva authored and davem330 committed Nov 5, 2017
1 parent 9525d69 commit 28e8c19
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions drivers/isdn/mISDN/l1oip_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 28e8c19

Please sign in to comment.