From patchwork Fri Jun 30 03:52:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 782648 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3wzN0k5kcxz9sNV for ; Fri, 30 Jun 2017 13:53:10 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Masu/XyU"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752017AbdF3DxJ (ORCPT ); Thu, 29 Jun 2017 23:53:09 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:34154 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751722AbdF3DxH (ORCPT ); Thu, 29 Jun 2017 23:53:07 -0400 Received: by mail-pg0-f67.google.com with SMTP id j186so13957536pge.1; Thu, 29 Jun 2017 20:53:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=1JVb8cNO3h0aGhVrI5XSY3Mu5GjD/+CH5Q3L2boZiMA=; b=Masu/XyUnXGyuVJArCumG0egDi6v13oFl0evpSKSCC/YWcqi8tym2+ZZ6acCdI+K+/ iHhPpu5P3Y4cTkv9jK1SGEMktrYzYwcd6hgDmFVnXbsS9oP97XcS5YSYWjbLtLqACL0d LKRNAlZZY+TifPEU5CNaTBOFJ8HCcGVLHxuFscsWoQjMP4gUHRWOdNklhgG1Tq4Jh21A Vc8DhHByJ9MOy+gEFXy/PkCMB7cEgfgF8vX2YaPGwDZiUWgksqbWPUtO9RQENWMppY81 eGd8IMQTbF6irtMjdCo5lqmlYFWvmojdWNnaa/49V6g9iNt7cJDwDmHlzkEwO3fxDluQ ppOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=1JVb8cNO3h0aGhVrI5XSY3Mu5GjD/+CH5Q3L2boZiMA=; b=llQpYPKkd0XN1ersp50HoRPWPc3y/tYQL+rnbRvbqamWeRmMQJMh6bb5UZrXBbY0p5 72d+odQfCN3MP3wDSgwwRtz2lLAizjgDpNRC8DTVck7UpyN3GBR7j1+4e0nVwuA6jBdv DGx702EIzH53++ukWwnjANFbidud/BasuQJCJOB3Xc/uBvVVMDYoKcziwzoiue8Nzy43 vN+FVIGFeCWin2nNlB9Hl/VRZAjbAKCutdc1/bkgHtM69EGFnkE6BT8u6/mr6v0rI1jp vkNXb5rnHzFkUZDAH4uW7HQaWn14QQxO3qvxG6Ba+yKCQ8UVolu+vhxTKSR17X87NzH0 pOVg== X-Gm-Message-State: AKS2vOxRQ8atuO0YPjCbXB3SwrDJsRBybokuJZif4eB6iqbJw52PPlKM +JS6u19GMUIP/ck1cX8= X-Received: by 10.84.176.3 with SMTP id u3mr21928316plb.134.1498794786392; Thu, 29 Jun 2017 20:53:06 -0700 (PDT) Received: from localhost ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id q19sm17633263pfd.24.2017.06.29.20.53.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Jun 2017 20:53:05 -0700 (PDT) From: Xin Long To: network dev , linux-sctp@vger.kernel.org Cc: Marcelo Ricardo Leitner , Neil Horman , davem@davemloft.net Subject: [PATCH net-next 03/11] sctp: remove the typedef sctp_cid_t Date: Fri, 30 Jun 2017 11:52:14 +0800 Message-Id: X-Mailer: git-send-email 2.1.0 In-Reply-To: <9b26ac600c9c3f9426b370ecd69261c25d220b2b.1498794482.git.lucien.xin@gmail.com> References: <9b26ac600c9c3f9426b370ecd69261c25d220b2b.1498794482.git.lucien.xin@gmail.com> In-Reply-To: References: Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch is to remove the typedef sctp_cid_t, and replace with struct sctp_cid in the places where it's using this typedef. Signed-off-by: Xin Long --- include/linux/sctp.h | 4 ++-- include/net/sctp/auth.h | 6 ++++-- include/net/sctp/constants.h | 4 ++-- include/net/sctp/structs.h | 2 +- net/sctp/auth.c | 6 +++--- net/sctp/sm_make_chunk.c | 4 ++-- net/sctp/sm_statetable.c | 4 ++-- 7 files changed, 16 insertions(+), 14 deletions(-) diff --git a/include/linux/sctp.h b/include/linux/sctp.h index 9ad5b9e..6d7b884 100644 --- a/include/linux/sctp.h +++ b/include/linux/sctp.h @@ -82,7 +82,7 @@ struct sctp_chunkhdr { * Value field. It takes a value from 0 to 254. The value of 255 is * reserved for future use as an extension field. */ -typedef enum { +enum sctp_cid { SCTP_CID_DATA = 0, SCTP_CID_INIT = 1, SCTP_CID_INIT_ACK = 2, @@ -109,7 +109,7 @@ typedef enum { SCTP_CID_ASCONF = 0xC1, SCTP_CID_ASCONF_ACK = 0x80, SCTP_CID_RECONF = 0x82, -} sctp_cid_t; /* enum */ +}; /* enum */ /* Section 3.2 diff --git a/include/net/sctp/auth.h b/include/net/sctp/auth.h index 9b9fb12..171244b 100644 --- a/include/net/sctp/auth.h +++ b/include/net/sctp/auth.h @@ -97,8 +97,10 @@ void sctp_auth_asoc_set_default_hmac(struct sctp_association *asoc, struct sctp_hmac_algo_param *hmacs); int sctp_auth_asoc_verify_hmac_id(const struct sctp_association *asoc, __be16 hmac_id); -int sctp_auth_send_cid(sctp_cid_t chunk, const struct sctp_association *asoc); -int sctp_auth_recv_cid(sctp_cid_t chunk, const struct sctp_association *asoc); +int sctp_auth_send_cid(enum sctp_cid chunk, + const struct sctp_association *asoc); +int sctp_auth_recv_cid(enum sctp_cid chunk, + const struct sctp_association *asoc); void sctp_auth_calculate_hmac(const struct sctp_association *asoc, struct sk_buff *skb, struct sctp_auth_chunk *auth, gfp_t gfp); diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index b07a745..02e867b 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h @@ -130,7 +130,7 @@ typedef enum { */ typedef union { - sctp_cid_t chunk; + enum sctp_cid chunk; sctp_event_timeout_t timeout; sctp_event_other_t other; sctp_event_primitive_t primitive; @@ -141,7 +141,7 @@ static inline sctp_subtype_t \ SCTP_ST_## _name (_type _arg) \ { sctp_subtype_t _retval; _retval._elt = _arg; return _retval; } -SCTP_SUBTYPE_CONSTRUCTOR(CHUNK, sctp_cid_t, chunk) +SCTP_SUBTYPE_CONSTRUCTOR(CHUNK, enum sctp_cid, chunk) SCTP_SUBTYPE_CONSTRUCTOR(TIMEOUT, sctp_event_timeout_t, timeout) SCTP_SUBTYPE_CONSTRUCTOR(OTHER, sctp_event_other_t, other) SCTP_SUBTYPE_CONSTRUCTOR(PRIMITIVE, sctp_event_primitive_t, primitive) diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index e26763b..9e9605e 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h @@ -1297,7 +1297,7 @@ int sctp_has_association(struct net *net, const union sctp_addr *laddr, int sctp_verify_init(struct net *net, const struct sctp_endpoint *ep, const struct sctp_association *asoc, - sctp_cid_t, sctp_init_chunk_t *peer_init, + enum sctp_cid cid, sctp_init_chunk_t *peer_init, struct sctp_chunk *chunk, struct sctp_chunk **err_chunk); int sctp_process_init(struct sctp_association *, struct sctp_chunk *chunk, const union sctp_addr *peer, diff --git a/net/sctp/auth.c b/net/sctp/auth.c index f99d485..7171dd3 100644 --- a/net/sctp/auth.c +++ b/net/sctp/auth.c @@ -632,7 +632,7 @@ void sctp_auth_asoc_set_default_hmac(struct sctp_association *asoc, /* Check to see if the given chunk is supposed to be authenticated */ -static int __sctp_auth_cid(sctp_cid_t chunk, struct sctp_chunks_param *param) +static int __sctp_auth_cid(enum sctp_cid chunk, struct sctp_chunks_param *param) { unsigned short len; int found = 0; @@ -668,7 +668,7 @@ static int __sctp_auth_cid(sctp_cid_t chunk, struct sctp_chunks_param *param) } /* Check if peer requested that this chunk is authenticated */ -int sctp_auth_send_cid(sctp_cid_t chunk, const struct sctp_association *asoc) +int sctp_auth_send_cid(enum sctp_cid chunk, const struct sctp_association *asoc) { if (!asoc) return 0; @@ -680,7 +680,7 @@ int sctp_auth_send_cid(sctp_cid_t chunk, const struct sctp_association *asoc) } /* Check if we requested that peer authenticate this chunk. */ -int sctp_auth_recv_cid(sctp_cid_t chunk, const struct sctp_association *asoc) +int sctp_auth_recv_cid(enum sctp_cid chunk, const struct sctp_association *asoc) { if (!asoc) return 0; diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index 7d4c5a8..78c3f21 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c @@ -2123,7 +2123,7 @@ static sctp_ierror_t sctp_verify_param(struct net *net, const struct sctp_endpoint *ep, const struct sctp_association *asoc, union sctp_params param, - sctp_cid_t cid, + enum sctp_cid cid, struct sctp_chunk *chunk, struct sctp_chunk **err_chunk) { @@ -2240,7 +2240,7 @@ static sctp_ierror_t sctp_verify_param(struct net *net, /* Verify the INIT packet before we process it. */ int sctp_verify_init(struct net *net, const struct sctp_endpoint *ep, - const struct sctp_association *asoc, sctp_cid_t cid, + const struct sctp_association *asoc, enum sctp_cid cid, sctp_init_chunk_t *peer_init, struct sctp_chunk *chunk, struct sctp_chunk **errp) { diff --git a/net/sctp/sm_statetable.c b/net/sctp/sm_statetable.c index 419b18e..3e958c1 100644 --- a/net/sctp/sm_statetable.c +++ b/net/sctp/sm_statetable.c @@ -53,7 +53,7 @@ static const sctp_sm_table_entry_t timeout_event_table[SCTP_NUM_TIMEOUT_TYPES][SCTP_STATE_NUM_STATES]; static const sctp_sm_table_entry_t *sctp_chunk_event_lookup(struct net *net, - sctp_cid_t cid, + enum sctp_cid cid, sctp_state_t state); @@ -968,7 +968,7 @@ static const sctp_sm_table_entry_t timeout_event_table[SCTP_NUM_TIMEOUT_TYPES][S }; static const sctp_sm_table_entry_t *sctp_chunk_event_lookup(struct net *net, - sctp_cid_t cid, + enum sctp_cid cid, sctp_state_t state) { if (state > SCTP_STATE_MAX)