netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xin Long <lucien.xin@gmail.com>
To: network dev <netdev@vger.kernel.org>, linux-sctp@vger.kernel.org
Cc: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
	Neil Horman <nhorman@tuxdriver.com>,
	davem@davemloft.net
Subject: [PATCH net-next 03/14] sctp: remove the typedef sctp_scope_policy_t
Date: Sat,  5 Aug 2017 19:59:53 +0800	[thread overview]
Message-ID: <09ffe75e4e16f00b61b682261e2a4b05fa76e814.1501934087.git.lucien.xin@gmail.com> (raw)
In-Reply-To: <7ceee2b1bf33403b8ecb04c9c30354f71dd2198a.1501934087.git.lucien.xin@gmail.com>
In-Reply-To: <cover.1501934086.git.lucien.xin@gmail.com>

This patch is to remove the typedef sctp_scope_policy_t and keep
it's members as an anonymous enum.

It is also to define SCTP_SCOPE_POLICY_MAX to replace the num 3
in sysctl.c to make codes clear.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
 include/net/sctp/constants.h | 6 ++++--
 net/sctp/sysctl.c            | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index 922fba5..acb03eb 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -341,12 +341,14 @@ typedef enum {
 	SCTP_SCOPE_UNUSABLE,		/* IPv4 unusable addresses */
 } sctp_scope_t;
 
-typedef enum {
+enum {
 	SCTP_SCOPE_POLICY_DISABLE,	/* Disable IPv4 address scoping */
 	SCTP_SCOPE_POLICY_ENABLE,	/* Enable IPv4 address scoping */
 	SCTP_SCOPE_POLICY_PRIVATE,	/* Follow draft but allow IPv4 private addresses */
 	SCTP_SCOPE_POLICY_LINK,		/* Follow draft but allow IPv4 link local addresses */
-} sctp_scope_policy_t;
+};
+
+#define SCTP_SCOPE_POLICY_MAX	SCTP_SCOPE_POLICY_LINK
 
 /* Based on IPv4 scoping <draft-stewart-tsvwg-sctp-ipv4-00.txt>,
  * SCTP IPv4 unusable addresses: 0.0.0.0/8, 224.0.0.0/4, 198.18.0.0/24,
diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c
index 0e732f6..ef7ca44 100644
--- a/net/sctp/sysctl.c
+++ b/net/sctp/sysctl.c
@@ -46,7 +46,7 @@ static int timer_max = 86400000; /* ms in one day */
 static int int_max = INT_MAX;
 static int sack_timer_min = 1;
 static int sack_timer_max = 500;
-static int addr_scope_max = 3; /* check sctp_scope_policy_t in include/net/sctp/constants.h for max entries */
+static int addr_scope_max = SCTP_SCOPE_POLICY_MAX;
 static int rwnd_scale_max = 16;
 static int rto_alpha_min = 0;
 static int rto_beta_min = 0;
-- 
2.1.0

  reply	other threads:[~2017-08-05 12:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-05 11:59 [PATCH net-next 00/14] sctp: remove typedefs from structures part 5 Xin Long
2017-08-05 11:59 ` [PATCH net-next 01/14] sctp: remove the typedef sctp_lower_cwnd_t Xin Long
2017-08-05 11:59   ` [PATCH net-next 02/14] sctp: remove the typedef sctp_retransmit_reason_t Xin Long
2017-08-05 11:59     ` Xin Long [this message]
2017-08-05 11:59       ` [PATCH net-next 04/14] sctp: remove the typedef sctp_scope_t Xin Long
2017-08-05 11:59         ` [PATCH net-next 05/14] sctp: remove the typedef sctp_transport_cmd_t Xin Long
2017-08-05 11:59           ` [PATCH net-next 06/14] sctp: remove the typedef sctp_sock_state_t Xin Long
2017-08-05 11:59             ` [PATCH net-next 07/14] sctp: remove the typedef sctp_xmit_t Xin Long
2017-08-05 11:59               ` [PATCH net-next 08/14] sctp: remove the typedef sctp_ierror_t Xin Long
2017-08-05 11:59                 ` [PATCH net-next 09/14] sctp: remove the typedef sctp_state_t Xin Long
2017-08-05 12:00                   ` [PATCH net-next 10/14] sctp: remove the typedef sctp_event_primitive_t Xin Long
2017-08-05 12:00                     ` [PATCH net-next 11/14] sctp: remove the typedef sctp_event_other_t Xin Long
2017-08-05 12:00                       ` [PATCH net-next 12/14] sctp: remove the typedef sctp_event_timeout_t Xin Long
2017-08-05 12:00                         ` [PATCH net-next 13/14] sctp: remove the typedef sctp_event_t Xin Long
2017-08-05 12:00                           ` [PATCH net-next 14/14] sctp: remove the typedef sctp_subtype_t Xin Long
2017-08-07  9:28       ` [PATCH net-next 03/14] sctp: remove the typedef sctp_scope_policy_t David Laight
2017-08-08  2:45         ` Xin Long
2017-08-07  4:33 ` [PATCH net-next 00/14] sctp: remove typedefs from structures part 5 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=09ffe75e4e16f00b61b682261e2a4b05fa76e814.1501934087.git.lucien.xin@gmail.com \
    --to=lucien.xin@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-sctp@vger.kernel.org \
    --cc=marcelo.leitner@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).