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

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

Merge branch 'sctp-typedef-remove-part-2'



Xin Long says:

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

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 2 to remove it for another 11 basic structures.

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

Note that v1->v2, nothing changed, just because net-next were closed when
posting v1.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents aed20a53 1474774a
Loading
Loading
Loading
Loading
+22 −27
Original line number Diff line number Diff line
@@ -273,69 +273,64 @@ struct sctp_init_chunk {


/* Section 3.3.2.1. IPv4 Address Parameter (5) */
typedef struct sctp_ipv4addr_param {
struct sctp_ipv4addr_param {
	struct sctp_paramhdr param_hdr;
	struct in_addr addr;
} sctp_ipv4addr_param_t;
};

/* Section 3.3.2.1. IPv6 Address Parameter (6) */
typedef struct sctp_ipv6addr_param {
struct sctp_ipv6addr_param {
	struct sctp_paramhdr param_hdr;
	struct in6_addr addr;
} sctp_ipv6addr_param_t;
};

/* Section 3.3.2.1 Cookie Preservative (9) */
typedef struct sctp_cookie_preserve_param {
struct sctp_cookie_preserve_param {
	struct sctp_paramhdr param_hdr;
	__be32 lifespan_increment;
} sctp_cookie_preserve_param_t;
};

/* Section 3.3.2.1 Host Name Address (11) */
typedef struct sctp_hostname_param {
struct sctp_hostname_param {
	struct sctp_paramhdr param_hdr;
	uint8_t hostname[0];
} sctp_hostname_param_t;
};

/* Section 3.3.2.1 Supported Address Types (12) */
typedef struct sctp_supported_addrs_param {
struct sctp_supported_addrs_param {
	struct sctp_paramhdr param_hdr;
	__be16 types[0];
} sctp_supported_addrs_param_t;

/* Appendix A. ECN Capable (32768) */
typedef struct sctp_ecn_capable_param {
	struct sctp_paramhdr param_hdr;
} sctp_ecn_capable_param_t;
};

/* ADDIP Section 3.2.6 Adaptation Layer Indication */
typedef struct sctp_adaptation_ind_param {
struct sctp_adaptation_ind_param {
	struct sctp_paramhdr param_hdr;
	__be32 adaptation_ind;
} sctp_adaptation_ind_param_t;
};

/* ADDIP Section 4.2.7 Supported Extensions Parameter */
typedef struct sctp_supported_ext_param {
struct sctp_supported_ext_param {
	struct sctp_paramhdr param_hdr;
	__u8 chunks[0];
} sctp_supported_ext_param_t;
};

/* AUTH Section 3.1 Random */
typedef struct sctp_random_param {
struct sctp_random_param {
	struct sctp_paramhdr param_hdr;
	__u8 random_val[0];
} sctp_random_param_t;
};

/* AUTH Section 3.2 Chunk List */
typedef struct sctp_chunks_param {
struct sctp_chunks_param {
	struct sctp_paramhdr param_hdr;
	__u8 chunks[0];
} sctp_chunks_param_t;
};

/* AUTH Section 3.3 HMAC Algorithm */
typedef struct sctp_hmac_algo_param {
struct sctp_hmac_algo_param {
	struct sctp_paramhdr param_hdr;
	__be16 hmac_ids[0];
} sctp_hmac_algo_param_t;
};

/* RFC 2960.  Section 3.3.3 Initiation Acknowledgement (INIT ACK) (2):
 *   The INIT ACK chunk is used to acknowledge the initiation of an SCTP
+3 −3
Original line number Diff line number Diff line
@@ -1556,9 +1556,9 @@ struct sctp_association {
		 * and authenticated chunk list.  All that is part of the
		 * cookie and these are just pointers to those locations
		 */
		sctp_random_param_t *peer_random;
		sctp_chunks_param_t *peer_chunks;
		sctp_hmac_algo_param_t *peer_hmacs;
		struct sctp_random_param *peer_random;
		struct sctp_chunks_param *peer_chunks;
		struct sctp_hmac_algo_param *peer_hmacs;
	} peer;

	/* State       : A state variable indicating what state the
+6 −7
Original line number Diff line number Diff line
@@ -185,9 +185,9 @@ static int sctp_auth_compare_vectors(struct sctp_auth_bytes *vector1,
 *    are called the two key vectors.
 */
static struct sctp_auth_bytes *sctp_auth_make_key_vector(
			sctp_random_param_t *random,
			sctp_chunks_param_t *chunks,
			sctp_hmac_algo_param_t *hmacs,
			struct sctp_random_param *random,
			struct sctp_chunks_param *chunks,
			struct sctp_hmac_algo_param *hmacs,
			gfp_t gfp)
{
	struct sctp_auth_bytes *new;
@@ -226,10 +226,9 @@ static struct sctp_auth_bytes *sctp_auth_make_local_vector(
				    gfp_t gfp)
{
	return sctp_auth_make_key_vector(
				    (sctp_random_param_t *)asoc->c.auth_random,
				    (sctp_chunks_param_t *)asoc->c.auth_chunks,
				    (sctp_hmac_algo_param_t *)asoc->c.auth_hmacs,
				    gfp);
			(struct sctp_random_param *)asoc->c.auth_random,
			(struct sctp_chunks_param *)asoc->c.auth_chunks,
			(struct sctp_hmac_algo_param *)asoc->c.auth_hmacs, gfp);
}

/* Make a key vector based on peer's parameters */
+4 −4
Original line number Diff line number Diff line
@@ -73,12 +73,12 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,
		 * variables.  There are arrays that we encode directly
		 * into parameters to make the rest of the operations easier.
		 */
		auth_hmacs = kzalloc(sizeof(sctp_hmac_algo_param_t) +
		auth_hmacs = kzalloc(sizeof(*auth_hmacs) +
				     sizeof(__u16) * SCTP_AUTH_NUM_HMACS, gfp);
		if (!auth_hmacs)
			goto nomem;

		auth_chunks = kzalloc(sizeof(sctp_chunks_param_t) +
		auth_chunks = kzalloc(sizeof(*auth_chunks) +
				      SCTP_NUM_CHUNK_TYPES, gfp);
		if (!auth_chunks)
			goto nomem;
+1 −1
Original line number Diff line number Diff line
@@ -497,7 +497,7 @@ static void sctp_v6_from_addr_param(union sctp_addr *addr,
static int sctp_v6_to_addr_param(const union sctp_addr *addr,
				 union sctp_addr_param *param)
{
	int length = sizeof(sctp_ipv6addr_param_t);
	int length = sizeof(struct sctp_ipv6addr_param);

	param->v6.param_hdr.type = SCTP_PARAM_IPV6_ADDRESS;
	param->v6.param_hdr.length = htons(length);
Loading