From: Xin Long <lucien.xin@gmail.com> Date: 2017-07-05 00:32:38
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.
Xin Long (11):
sctp: remove the typedef sctp_ipv4addr_param_t
sctp: remove the typedef sctp_ipv6addr_param_t
sctp: remove the typedef sctp_cookie_preserve_param_t
sctp: remove the typedef sctp_hostname_param_t
sctp: remove the typedef sctp_supported_addrs_param_t
sctp: remove struct sctp_ecn_capable_param
sctp: remove the typedef sctp_adaptation_ind_param_t
sctp: remove the typedef sctp_supported_ext_param_t
sctp: remove the typedef sctp_random_param_t
sctp: remove the typedef sctp_chunks_param_t
sctp: remove the typedef sctp_hmac_algo_param_t
include/linux/sctp.h | 49 +++++++++++++++++++++-------------------------
include/net/sctp/structs.h | 6 +++---
net/sctp/auth.c | 13 ++++++------
net/sctp/endpointola.c | 8 ++++----
net/sctp/ipv6.c | 2 +-
net/sctp/protocol.c | 2 +-
net/sctp/sm_make_chunk.c | 32 ++++++++++++------------------
net/sctp/sm_statefuns.c | 11 +++++------
8 files changed, 55 insertions(+), 68 deletions(-)
--
2.1.0
From: Xin Long <lucien.xin@gmail.com> Date: 2017-07-05 00:32:46
This patch is to remove the typedef sctp_ipv4addr_param_t, and replace
with struct sctp_ipv4addr_param in the places where it's using this
typedef.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
include/linux/sctp.h | 6 +++---
net/sctp/protocol.c | 2 +-
net/sctp/sm_make_chunk.c | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
@@ -3153,7 +3153,7 @@ bool sctp_verify_asconf(const struct sctp_association *asoc,caseSCTP_PARAM_ERR_CAUSE:break;caseSCTP_PARAM_IPV4_ADDRESS:-if(length!=sizeof(sctp_ipv4addr_param_t))+if(length!=sizeof(structsctp_ipv4addr_param))returnfalse;/* ensure there is only one addr param and it's in the*beginningofaddip_hdrparams,orwerejectit.
From: Xin Long <lucien.xin@gmail.com> Date: 2017-07-05 00:32:55
This patch is to remove the typedef sctp_ipv6addr_param_t, and replace
with struct sctp_ipv6addr_param in the places where it's using this
typedef.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
include/linux/sctp.h | 4 ++--
net/sctp/ipv6.c | 2 +-
net/sctp/sm_make_chunk.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
From: Xin Long <lucien.xin@gmail.com> Date: 2017-07-05 00:33:03
This patch is to remove the typedef sctp_cookie_preserve_param_t, and
replace with struct sctp_cookie_preserve_param in the places where it's
using this typedef.
It is also to fix some indents in sctp_sf_do_5_2_6_stale().
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
include/linux/sctp.h | 6 +++---
net/sctp/sm_statefuns.c | 11 +++++------
2 files changed, 8 insertions(+), 9 deletions(-)
From: Xin Long <lucien.xin@gmail.com> Date: 2017-07-05 00:33:16
Remove this typedef, there is even no places using it.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
include/linux/sctp.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
From: Xin Long <lucien.xin@gmail.com> Date: 2017-07-05 00:33:27
Remove it, there is even no places using it.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
include/linux/sctp.h | 5 -----
1 file changed, 5 deletions(-)
From: Xin Long <lucien.xin@gmail.com> Date: 2017-07-05 00:33:29
This patch is to remove the typedef sctp_supported_addrs_param_t, and
replace with struct sctp_supported_addrs_param in the places where it's
using this typedef.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
include/linux/sctp.h | 4 ++--
net/sctp/sm_make_chunk.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
From: Xin Long <lucien.xin@gmail.com> Date: 2017-07-05 00:33:35
This patch is to remove the typedef sctp_adaptation_ind_param_t, and
replace with struct sctp_adaptation_ind_param in the places where it's
using this typedef.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
include/linux/sctp.h | 4 ++--
net/sctp/sm_make_chunk.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
From: Xin Long <lucien.xin@gmail.com> Date: 2017-07-05 00:33:47
This patch is to remove the typedef sctp_supported_ext_param_t, and
replace with struct sctp_supported_ext_param in the places where it's
using this typedef.
It is also to use sizeof(variable) instead of sizeof(type).
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
include/linux/sctp.h | 4 ++--
net/sctp/sm_make_chunk.c | 22 ++++++++--------------
2 files changed, 10 insertions(+), 16 deletions(-)
@@ -305,8 +305,7 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,/* If we have any extensions to report, account for that */if(num_ext)-chunksize+=SCTP_PAD4(sizeof(sctp_supported_ext_param_t)+-num_ext);+chunksize+=SCTP_PAD4(sizeof(ext_param)+num_ext);/* RFC 2960 3.3.2 Initiation (INIT) (1)*
@@ -468,8 +465,7 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc,}if(num_ext)-chunksize+=SCTP_PAD4(sizeof(sctp_supported_ext_param_t)+-num_ext);+chunksize+=SCTP_PAD4(sizeof(ext_param)+num_ext);/* Now allocate and fill out the chunk. */retval=sctp_make_control(asoc,SCTP_CID_INIT_ACK,0,chunksize,gfp);
From: Xin Long <lucien.xin@gmail.com> Date: 2017-07-05 00:33:55
This patch is to remove the typedef sctp_random_param_t, and
replace with struct sctp_random_param in the places where it's
using this typedef.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
include/linux/sctp.h | 4 ++--
include/net/sctp/structs.h | 2 +-
net/sctp/auth.c | 9 ++++-----
3 files changed, 7 insertions(+), 8 deletions(-)
@@ -185,7 +185,7 @@ static int sctp_auth_compare_vectors(struct sctp_auth_bytes *vector1,*arecalledthetwokeyvectors.*/staticstructsctp_auth_bytes*sctp_auth_make_key_vector(-sctp_random_param_t*random,+structsctp_random_param*random,sctp_chunks_param_t*chunks,sctp_hmac_algo_param_t*hmacs,gfp_tgfp)
@@ -226,10 +226,9 @@ static struct sctp_auth_bytes *sctp_auth_make_local_vector(gfp_tgfp){returnsctp_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);+(structsctp_random_param*)asoc->c.auth_random,+(sctp_chunks_param_t*)asoc->c.auth_chunks,+(sctp_hmac_algo_param_t*)asoc->c.auth_hmacs,gfp);}/* Make a key vector based on peer's parameters */
From: Xin Long <lucien.xin@gmail.com> Date: 2017-07-05 00:34:03
This patch is to remove the typedef sctp_chunks_param_t, and
replace with struct sctp_chunks_param in the places where it's
using this typedef.
It is also to use sizeof(variable) instead of sizeof(type).
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
include/linux/sctp.h | 4 ++--
include/net/sctp/structs.h | 2 +-
net/sctp/auth.c | 4 ++--
net/sctp/endpointola.c | 4 ++--
4 files changed, 7 insertions(+), 7 deletions(-)
From: Xin Long <lucien.xin@gmail.com> Date: 2017-07-05 00:34:16
This patch is to remove the typedef sctp_hmac_algo_param_t, and
replace with struct sctp_hmac_algo_param in the places where it's
using this typedef.
It is also to use sizeof(variable) instead of sizeof(type).
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
include/linux/sctp.h | 4 ++--
include/net/sctp/structs.h | 2 +-
net/sctp/auth.c | 4 ++--
net/sctp/endpointola.c | 4 ++--
4 files changed, 7 insertions(+), 7 deletions(-)
@@ -1558,7 +1558,7 @@ struct sctp_association {*/structsctp_random_param*peer_random;structsctp_chunks_param*peer_chunks;-sctp_hmac_algo_param_t*peer_hmacs;+structsctp_hmac_algo_param*peer_hmacs;}peer;/* State : A state variable indicating what state the
@@ -187,7 +187,7 @@ static int sctp_auth_compare_vectors(struct sctp_auth_bytes *vector1,staticstructsctp_auth_bytes*sctp_auth_make_key_vector(structsctp_random_param*random,structsctp_chunks_param*chunks,-sctp_hmac_algo_param_t*hmacs,+structsctp_hmac_algo_param*hmacs,gfp_tgfp){structsctp_auth_bytes*new;
@@ -228,7 +228,7 @@ static struct sctp_auth_bytes *sctp_auth_make_local_vector(returnsctp_auth_make_key_vector((structsctp_random_param*)asoc->c.auth_random,(structsctp_chunks_param*)asoc->c.auth_chunks,-(sctp_hmac_algo_param_t*)asoc->c.auth_hmacs,gfp);+(structsctp_hmac_algo_param*)asoc->c.auth_hmacs,gfp);}/* Make a key vector based on peer's parameters */
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.
net-next is closed, please resubmit this when the tree opens back
up.