Commit b7792e34cba641c49cd436d42fbfd2a632ff39d3

Authored by andrew hendry
Committed by David S. Miller
1 parent cb863ffd4a

X25: Move interrupt flag to bitfield

Moves the x25 interrupt flag from char into bitfield.

Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 4 changed files with 7 additions and 4 deletions Side-by-side Diff

... ... @@ -115,6 +115,7 @@
115 115  
116 116 /* Bitset in x25_sock->flags for misc flags */
117 117 #define X25_Q_BIT_FLAG 0
  118 +#define X25_INTERRUPT_FLAG 1
118 119  
119 120 /**
120 121 * struct x25_route - x25 routing entry
... ... @@ -149,7 +150,7 @@
149 150 struct x25_address source_addr, dest_addr;
150 151 struct x25_neigh *neighbour;
151 152 unsigned int lci, cudmatchlength;
152   - unsigned char state, condition, intflag, accptapprv;
  153 + unsigned char state, condition, accptapprv;
153 154 unsigned short vs, vr, va, vl;
154 155 unsigned long t2, t21, t22, t23;
155 156 unsigned short fraglen;
... ... @@ -641,6 +641,7 @@
641 641 x25->cudmatchlength = ox25->cudmatchlength;
642 642 x25->accptapprv = ox25->accptapprv;
643 643  
  644 + clear_bit(X25_INTERRUPT_FLAG, &x25->flags);
644 645 x25_init_timers(sk);
645 646 out:
646 647 return sk;
... ... @@ -273,7 +273,7 @@
273 273 break;
274 274  
275 275 case X25_INTERRUPT_CONFIRMATION:
276   - x25->intflag = 0;
  276 + clear_bit(X25_INTERRUPT_FLAG, &x25->flags);
277 277 break;
278 278  
279 279 case X25_INTERRUPT:
... ... @@ -148,8 +148,9 @@
148 148 /*
149 149 * Transmit interrupt data.
150 150 */
151   - if (!x25->intflag && skb_peek(&x25->interrupt_out_queue) != NULL) {
152   - x25->intflag = 1;
  151 + if (skb_peek(&x25->interrupt_out_queue) != NULL &&
  152 + !test_and_set_bit(X25_INTERRUPT_FLAG, &x25->flags)) {
  153 +
153 154 skb = skb_dequeue(&x25->interrupt_out_queue);
154 155 x25_transmit_link(skb, x25->neighbour);
155 156 }