All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: Joe Perches <joe@perches.com>
Cc: Vlad Yasevich <vyasevich@gmail.com>,
	Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	linux-sctp@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: sctp: Rename fallthrough label to unhandled
Date: Wed, 31 Jul 2019 07:19:32 -0400	[thread overview]
Message-ID: <20190731111932.GA9823@hmswarspite.think-freely.org> (raw)
In-Reply-To: <e0dd3af448e38e342c1ac6e7c0c802696eb77fd6.1564549413.git.joe@perches.com>

On Tue, Jul 30, 2019 at 10:04:37PM -0700, Joe Perches wrote:
> fallthrough may become a pseudo reserved keyword so this only use of
> fallthrough is better renamed to allow it.
> 
> Signed-off-by: Joe Perches <joe@perches.com>
Are you referring to the __attribute__((fallthrough)) statement that gcc
supports?  If so the compiler should by all rights be able to differentiate
between a null statement attribute and a explicit goto and label without the
need for renaming here.  Or are you referring to something else?

Neil

> ---
>  net/sctp/sm_make_chunk.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
> index 36bd8a6e82df..3fdcaa2fbf12 100644
> --- a/net/sctp/sm_make_chunk.c
> +++ b/net/sctp/sm_make_chunk.c
> @@ -2152,7 +2152,7 @@ static enum sctp_ierror sctp_verify_param(struct net *net,
>  	case SCTP_PARAM_SET_PRIMARY:
>  		if (net->sctp.addip_enable)
>  			break;
> -		goto fallthrough;
> +		goto unhandled;
>  
>  	case SCTP_PARAM_HOST_NAME_ADDRESS:
>  		/* Tell the peer, we won't support this param.  */
> @@ -2163,11 +2163,11 @@ static enum sctp_ierror sctp_verify_param(struct net *net,
>  	case SCTP_PARAM_FWD_TSN_SUPPORT:
>  		if (ep->prsctp_enable)
>  			break;
> -		goto fallthrough;
> +		goto unhandled;
>  
>  	case SCTP_PARAM_RANDOM:
>  		if (!ep->auth_enable)
> -			goto fallthrough;
> +			goto unhandled;
>  
>  		/* SCTP-AUTH: Secion 6.1
>  		 * If the random number is not 32 byte long the association
> @@ -2184,7 +2184,7 @@ static enum sctp_ierror sctp_verify_param(struct net *net,
>  
>  	case SCTP_PARAM_CHUNKS:
>  		if (!ep->auth_enable)
> -			goto fallthrough;
> +			goto unhandled;
>  
>  		/* SCTP-AUTH: Section 3.2
>  		 * The CHUNKS parameter MUST be included once in the INIT or
> @@ -2200,7 +2200,7 @@ static enum sctp_ierror sctp_verify_param(struct net *net,
>  
>  	case SCTP_PARAM_HMAC_ALGO:
>  		if (!ep->auth_enable)
> -			goto fallthrough;
> +			goto unhandled;
>  
>  		hmacs = (struct sctp_hmac_algo_param *)param.p;
>  		n_elt = (ntohs(param.p->length) -
> @@ -2223,7 +2223,7 @@ static enum sctp_ierror sctp_verify_param(struct net *net,
>  			retval = SCTP_IERROR_ABORT;
>  		}
>  		break;
> -fallthrough:
> +unhandled:
>  	default:
>  		pr_debug("%s: unrecognized param:%d for chunk:%d\n",
>  			 __func__, ntohs(param.p->type), cid);
> -- 
> 2.15.0
> 
> 

WARNING: multiple messages have this Message-ID (diff)
From: Neil Horman <nhorman@tuxdriver.com>
To: Joe Perches <joe@perches.com>
Cc: Vlad Yasevich <vyasevich@gmail.com>,
	Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	linux-sctp@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: sctp: Rename fallthrough label to unhandled
Date: Wed, 31 Jul 2019 11:19:32 +0000	[thread overview]
Message-ID: <20190731111932.GA9823@hmswarspite.think-freely.org> (raw)
In-Reply-To: <e0dd3af448e38e342c1ac6e7c0c802696eb77fd6.1564549413.git.joe@perches.com>

On Tue, Jul 30, 2019 at 10:04:37PM -0700, Joe Perches wrote:
> fallthrough may become a pseudo reserved keyword so this only use of
> fallthrough is better renamed to allow it.
> 
> Signed-off-by: Joe Perches <joe@perches.com>
Are you referring to the __attribute__((fallthrough)) statement that gcc
supports?  If so the compiler should by all rights be able to differentiate
between a null statement attribute and a explicit goto and label without the
need for renaming here.  Or are you referring to something else?

Neil

> ---
>  net/sctp/sm_make_chunk.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
> index 36bd8a6e82df..3fdcaa2fbf12 100644
> --- a/net/sctp/sm_make_chunk.c
> +++ b/net/sctp/sm_make_chunk.c
> @@ -2152,7 +2152,7 @@ static enum sctp_ierror sctp_verify_param(struct net *net,
>  	case SCTP_PARAM_SET_PRIMARY:
>  		if (net->sctp.addip_enable)
>  			break;
> -		goto fallthrough;
> +		goto unhandled;
>  
>  	case SCTP_PARAM_HOST_NAME_ADDRESS:
>  		/* Tell the peer, we won't support this param.  */
> @@ -2163,11 +2163,11 @@ static enum sctp_ierror sctp_verify_param(struct net *net,
>  	case SCTP_PARAM_FWD_TSN_SUPPORT:
>  		if (ep->prsctp_enable)
>  			break;
> -		goto fallthrough;
> +		goto unhandled;
>  
>  	case SCTP_PARAM_RANDOM:
>  		if (!ep->auth_enable)
> -			goto fallthrough;
> +			goto unhandled;
>  
>  		/* SCTP-AUTH: Secion 6.1
>  		 * If the random number is not 32 byte long the association
> @@ -2184,7 +2184,7 @@ static enum sctp_ierror sctp_verify_param(struct net *net,
>  
>  	case SCTP_PARAM_CHUNKS:
>  		if (!ep->auth_enable)
> -			goto fallthrough;
> +			goto unhandled;
>  
>  		/* SCTP-AUTH: Section 3.2
>  		 * The CHUNKS parameter MUST be included once in the INIT or
> @@ -2200,7 +2200,7 @@ static enum sctp_ierror sctp_verify_param(struct net *net,
>  
>  	case SCTP_PARAM_HMAC_ALGO:
>  		if (!ep->auth_enable)
> -			goto fallthrough;
> +			goto unhandled;
>  
>  		hmacs = (struct sctp_hmac_algo_param *)param.p;
>  		n_elt = (ntohs(param.p->length) -
> @@ -2223,7 +2223,7 @@ static enum sctp_ierror sctp_verify_param(struct net *net,
>  			retval = SCTP_IERROR_ABORT;
>  		}
>  		break;
> -fallthrough:
> +unhandled:
>  	default:
>  		pr_debug("%s: unrecognized param:%d for chunk:%d\n",
>  			 __func__, ntohs(param.p->type), cid);
> -- 
> 2.15.0
> 
> 

  parent reply	other threads:[~2019-07-31 11:20 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-31  5:04 [PATCH] net: sctp: Rename fallthrough label to unhandled Joe Perches
2019-07-31  5:04 ` Joe Perches
2019-07-31  5:35 ` [RFC PATCH] compiler_attributes.h: Add 'fallthrough' pseudo keyword for switch/case use Joe Perches
2019-07-31  9:02   ` Peter Zijlstra
2019-07-31  9:34     ` Joe Perches
2019-07-31 17:14   ` Pavel Machek
2019-07-31 17:51     ` Joe Perches
2019-07-31 18:24       ` hpa
2019-07-31 18:48         ` Peter Zijlstra
2019-07-31 20:02           ` Kees Cook
2019-07-31 20:59             ` Miguel Ojeda
2019-07-31 22:07               ` Joe Perches
2019-08-01  0:00                 ` Miguel Ojeda
2019-08-01 12:25             ` Peter Zijlstra
2019-08-15 18:15             ` Kees Cook
2019-08-15 22:31               ` Kees Cook
2019-09-16 22:19               ` treewide replacement of fallthrough comments with "fallthrough" macro (was Re: [RFC PATCH] compiler_attributes.h: Add 'fallthrough' pseudo keyword for switch/case use) Kees Cook
2019-09-17 22:26                 ` Joe Perches
2019-09-17 23:38                   ` Kees Cook
2019-07-31 21:01           ` [RFC PATCH] compiler_attributes.h: Add 'fallthrough' pseudo keyword for switch/case use hpa
2019-07-31 23:55             ` Miguel Ojeda
2019-08-01  6:10               ` hpa
2019-08-01  7:52                 ` Joe Perches
2019-08-01 12:24                 ` Peter Zijlstra
2019-08-01 20:09                   ` hpa
2019-08-01 20:26                     ` Miguel Ojeda
2019-08-01 20:47                       ` Joe Perches
2019-08-02 11:00                       ` Neil Horman
2019-08-02 12:34                         ` Pavel Machek
2019-08-02 16:09                           ` Kees Cook
2019-08-02 16:16                             ` Joe Perches
2019-08-04 18:01   ` Joe Perches
2019-08-04 18:09     ` Linus Torvalds
2019-08-04 19:38       ` Miguel Ojeda
2019-08-05  0:39       ` Joe Perches
2019-08-05  1:18         ` Nathan Chancellor
2019-08-05  2:01           ` Joe Perches
2019-07-31 11:19 ` Neil Horman [this message]
2019-07-31 11:19   ` [PATCH] net: sctp: Rename fallthrough label to unhandled Neil Horman
2019-07-31 11:32   ` Joe Perches
2019-07-31 11:32     ` Joe Perches
2019-07-31 12:16     ` Neil Horman
2019-07-31 12:16       ` Neil Horman
2019-07-31 16:35       ` Joe Perches
2019-07-31 16:35         ` Joe Perches
2019-07-31 20:58         ` Neil Horman
2019-07-31 20:58           ` Neil Horman
2019-07-31 22:23           ` Joe Perches
2019-07-31 22:23             ` Joe Perches
2019-08-01 10:50             ` Neil Horman
2019-08-01 10:50               ` Neil Horman
2019-08-01 17:42               ` Joe Perches
2019-08-01 17:42                 ` Joe Perches
2019-08-01 20:48                 ` Neil Horman
2019-08-01 20:48                   ` Neil Horman
2019-08-05 11:49                 ` David Laight
2019-08-05 11:49                   ` David Laight
2019-08-02 17:47       ` Joe Perches
2019-08-02 17:47         ` Joe Perches
2019-08-02 23:19         ` David Miller
2019-08-02 23:19           ` David Miller
2019-08-02 23:26           ` Joe Perches
2019-08-02 23:26             ` Joe Perches
2019-08-03 18:01           ` Joe Perches
2019-08-03 18:01             ` Joe Perches
2019-08-04 19:26           ` Neil Horman
2019-08-04 19:26             ` Neil Horman
2019-08-02 17:50 ` Neil Horman
2019-08-02 17:50   ` Neil Horman

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=20190731111932.GA9823@hmswarspite.think-freely.org \
    --to=nhorman@tuxdriver.com \
    --cc=davem@davemloft.net \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sctp@vger.kernel.org \
    --cc=marcelo.leitner@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=vyasevich@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.