Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a9bef4e authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'sctp-remove-typedefs-from-structures-part-3'



Xin Long says:

====================
sctp: remove typedefs from structures part 3

As we know, typedef is suggested not to use in kernel, even checkpatch.pl
also gives warnings about it. Now sctp is using it for many structures.

All this kind of typedef's using should be removed. This patchset is the
part 3 to remove it for another 11 basic structures from linux/sctp.h.

Just as the part 1 and 2, No any code's logic would be changed in these
patches, only cleaning up.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 56eda01d 441ae65a
Loading
Loading
Loading
Loading
+27 −26
Original line number Diff line number Diff line
@@ -336,19 +336,22 @@ struct sctp_hmac_algo_param {
 *   The INIT ACK chunk is used to acknowledge the initiation of an SCTP
 *   association.
 */
typedef struct sctp_init_chunk sctp_initack_chunk_t;
struct sctp_initack_chunk {
	struct sctp_chunkhdr chunk_hdr;
	struct sctp_inithdr init_hdr;
};

/* Section 3.3.3.1 State Cookie (7) */
typedef struct sctp_cookie_param {
struct sctp_cookie_param {
	struct sctp_paramhdr p;
	__u8 body[0];
} sctp_cookie_param_t;
};

/* Section 3.3.3.1 Unrecognized Parameters (8) */
typedef struct sctp_unrecognized_param {
struct sctp_unrecognized_param {
	struct sctp_paramhdr param_hdr;
	struct sctp_paramhdr unrecognized;
} sctp_unrecognized_param_t;
};



@@ -360,30 +363,28 @@ typedef struct sctp_unrecognized_param {
 *  subsequences of DATA chunks as represented by their TSNs.
 */

typedef struct sctp_gap_ack_block {
struct sctp_gap_ack_block {
	__be16 start;
	__be16 end;
} sctp_gap_ack_block_t;

typedef __be32 sctp_dup_tsn_t;
};

typedef union {
	sctp_gap_ack_block_t	gab;
        sctp_dup_tsn_t		dup;
} sctp_sack_variable_t;
union sctp_sack_variable {
	struct sctp_gap_ack_block gab;
	__be32 dup;
};

typedef struct sctp_sackhdr {
struct sctp_sackhdr {
	__be32 cum_tsn_ack;
	__be32 a_rwnd;
	__be16 num_gap_ack_blocks;
	__be16 num_dup_tsns;
	sctp_sack_variable_t variable[0];
} sctp_sackhdr_t;
	union sctp_sack_variable variable[0];
};

typedef struct sctp_sack_chunk {
struct sctp_sack_chunk {
	struct sctp_chunkhdr chunk_hdr;
	sctp_sackhdr_t sack_hdr;
} sctp_sack_chunk_t;
	struct sctp_sackhdr sack_hdr;
};


/* RFC 2960.  Section 3.3.5 Heartbeat Request (HEARTBEAT) (4):
@@ -393,23 +394,23 @@ typedef struct sctp_sack_chunk {
 *  the present association.
 */

typedef struct sctp_heartbeathdr {
struct sctp_heartbeathdr {
	struct sctp_paramhdr info;
} sctp_heartbeathdr_t;
};

typedef struct sctp_heartbeat_chunk {
struct sctp_heartbeat_chunk {
	struct sctp_chunkhdr chunk_hdr;
	sctp_heartbeathdr_t hb_hdr;
} sctp_heartbeat_chunk_t;
	struct sctp_heartbeathdr hb_hdr;
};


/* For the abort and shutdown ACK we must carry the init tag in the
 * common header. Just the common header is all that is needed with a
 * chunk descriptor.
 */
typedef struct sctp_abort_chunk {
struct sctp_abort_chunk {
	struct sctp_chunkhdr uh;
} sctp_abort_chunk_t;
};


/* For the graceful shutdown we must carry the tag (in common header)
+2 −2
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ typedef union {
	struct sctp_init_chunk *init;
	struct sctp_ulpevent *ulpevent;
	struct sctp_packet *packet;
	sctp_sackhdr_t *sackh;
	struct sctp_sackhdr *sackh;
	struct sctp_datamsg *msg;
} sctp_arg_t;

@@ -176,7 +176,7 @@ SCTP_ARG_CONSTRUCTOR(BA, struct sctp_bind_addr *, bp)
SCTP_ARG_CONSTRUCTOR(PEER_INIT,	struct sctp_init_chunk *, init)
SCTP_ARG_CONSTRUCTOR(ULPEVENT,  struct sctp_ulpevent *, ulpevent)
SCTP_ARG_CONSTRUCTOR(PACKET,	struct sctp_packet *, packet)
SCTP_ARG_CONSTRUCTOR(SACKH,	sctp_sackhdr_t *, sackh)
SCTP_ARG_CONSTRUCTOR(SACKH,	struct sctp_sackhdr *, sackh)
SCTP_ARG_CONSTRUCTOR(DATAMSG,	struct sctp_datamsg *, msg)

static inline sctp_arg_t SCTP_FORCE(void)
+1 −1
Original line number Diff line number Diff line
@@ -221,7 +221,7 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,
	    asoc->outqueue.out_qlen == 0 &&
	    list_empty(&asoc->outqueue.retransmit) &&
	    msg_len > max_data)
		first_len -= SCTP_PAD4(sizeof(sctp_sack_chunk_t));
		first_len -= SCTP_PAD4(sizeof(struct sctp_sack_chunk));

	/* Encourage Cookie-ECHO bundling. */
	if (asoc->state < SCTP_STATE_COOKIE_ECHOED)
+5 −5
Original line number Diff line number Diff line
@@ -1197,7 +1197,7 @@ static void sctp_outq_flush(struct sctp_outq *q, int rtx_timeout, gfp_t gfp)
static void sctp_sack_update_unack_data(struct sctp_association *assoc,
					struct sctp_sackhdr *sack)
{
	sctp_sack_variable_t *frags;
	union sctp_sack_variable *frags;
	__u16 unack_data;
	int i;

@@ -1224,7 +1224,7 @@ int sctp_outq_sack(struct sctp_outq *q, struct sctp_chunk *chunk)
	struct sctp_transport *transport;
	struct sctp_chunk *tchunk = NULL;
	struct list_head *lchunk, *transport_list, *temp;
	sctp_sack_variable_t *frags = sack->variable;
	union sctp_sack_variable *frags = sack->variable;
	__u32 sack_ctsn, ctsn, tsn;
	__u32 highest_tsn, highest_new_tsn;
	__u32 sack_a_rwnd;
@@ -1736,10 +1736,10 @@ static void sctp_mark_missing(struct sctp_outq *q,
/* Is the given TSN acked by this packet?  */
static int sctp_acked(struct sctp_sackhdr *sack, __u32 tsn)
{
	int i;
	sctp_sack_variable_t *frags;
	__u16 tsn_offset, blocks;
	__u32 ctsn = ntohl(sack->cum_tsn_ack);
	union sctp_sack_variable *frags;
	__u16 tsn_offset, blocks;
	int i;

	if (TSN_lte(tsn, ctsn))
		goto pass;
+10 −8
Original line number Diff line number Diff line
@@ -69,7 +69,8 @@ static struct sctp_chunk *sctp_make_data(const struct sctp_association *asoc,
static struct sctp_chunk *_sctp_make_chunk(const struct sctp_association *asoc,
					   __u8 type, __u8 flags, int paylen,
					   gfp_t gfp);
static sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep,
static struct sctp_cookie_param *sctp_pack_cookie(
					const struct sctp_endpoint *ep,
					const struct sctp_association *asoc,
					const struct sctp_chunk *init_chunk,
					int *cookie_len,
@@ -387,7 +388,7 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc,
	union sctp_params addrs;
	struct sctp_sock *sp;
	int addrs_len;
	sctp_cookie_param_t *cookie;
	struct sctp_cookie_param *cookie;
	int cookie_len;
	size_t chunksize;
	struct sctp_adaptation_ind_param aiparam;
@@ -1595,14 +1596,15 @@ struct sctp_association *sctp_make_temp_asoc(const struct sctp_endpoint *ep,
/* Build a cookie representing asoc.
 * This INCLUDES the param header needed to put the cookie in the INIT ACK.
 */
static sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep,
static struct sctp_cookie_param *sctp_pack_cookie(
					const struct sctp_endpoint *ep,
					const struct sctp_association *asoc,
					const struct sctp_chunk *init_chunk,
					int *cookie_len,
					const __u8 *raw_addrs, int addrs_len)
{
	sctp_cookie_param_t *retval;
	struct sctp_signed_cookie *cookie;
	struct sctp_cookie_param *retval;
	int headersize, bodysize;

	/* Header size is static data prior to the actual cookie, including
Loading