Skip to content

Commit 0022d2d

Browse files
Daniel Borkmanndavem330
authored andcommitted
net: sctp: minor: make sctp_ep_common's member 'dead' a bool
Since dead only holds two states (0,1), make it a bool instead of a 'char', which is more appropriate for its purpose. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Vlad Yasevich <vyasevich@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent ff2266c commit 0022d2d

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎include/net/sctp/structs.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,7 @@ struct sctp_ep_common {
11761176
* dead - Do not attempt to use this object.
11771177
*/
11781178
atomic_t refcnt;
1179-
char dead;
1179+
bool dead;
11801180

11811181
/* What socket does this endpoint belong to? */
11821182
struct sock *sk;

‎net/sctp/associola.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a
104104

105105
/* Initialize the object handling fields. */
106106
atomic_set(&asoc->base.refcnt, 1);
107-
asoc->base.dead = 0;
107+
asoc->base.dead = false;
108108

109109
/* Initialize the bind addr area. */
110110
sctp_bind_addr_init(&asoc->base.bind_addr, ep->base.bind_addr.port);
@@ -407,7 +407,7 @@ void sctp_association_free(struct sctp_association *asoc)
407407
/* Mark as dead, so other users can know this structure is
408408
* going away.
409409
*/
410-
asoc->base.dead = 1;
410+
asoc->base.dead = true;
411411

412412
/* Dispose of any data lying around in the outqueue. */
413413
sctp_outq_free(&asoc->outqueue);

‎net/sctp/endpointola.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,
121121

122122
/* Initialize the basic object fields. */
123123
atomic_set(&ep->base.refcnt, 1);
124-
ep->base.dead = 0;
124+
ep->base.dead = false;
125125

126126
/* Create an input queue. */
127127
sctp_inq_init(&ep->base.inqueue);
@@ -233,7 +233,7 @@ void sctp_endpoint_add_asoc(struct sctp_endpoint *ep,
233233
*/
234234
void sctp_endpoint_free(struct sctp_endpoint *ep)
235235
{
236-
ep->base.dead = 1;
236+
ep->base.dead = true;
237237

238238
ep->base.sk->sk_state = SCTP_SS_CLOSED;
239239

0 commit comments

Comments
 (0)