Subject: Re: [PATCH 5/12] Add descriptions to constants

From: Ingo Oeser <[email-masked]>
Date: Mon, 12 Sep 2005 18:41:53 +0200

Hi Ralf,

Ralf Baechle DL5RB wrote:
> Comment the names used for the AX.25 state machine.

What about making it even more useful by aliasing the enum elements?

> Signed-off-by: Ralf Baechle DL5RB <[email-masked]>
>
>  include/net/ax25.h |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)
>
> Index: linux-cvs/include/net/ax25.h
> ===================================================================
> --- linux-cvs.orig/include/net/ax25.h
> +++ linux-cvs/include/net/ax25.h
> @@ -97,11 +97,11 @@
>  /* Define Link State constants. */
>
>  enum {
> -	AX25_STATE_0,
> -	AX25_STATE_1,
> -	AX25_STATE_2,
> -	AX25_STATE_3,
> -	AX25_STATE_4
> +	AX25_STATE_0,			/* Listening */
    +  AX25_STATE_LISTENING = AX25_STATE_0,
> +	AX25_STATE_1,			/* SABM sent */
    +  AX25_STATE_SABM_SENT = AX25_STATE_1,
> +	AX25_STATE_2,			/* DISC sent */
    +  AX25_STATE_DISC_SENT = AX25_STATE_2,
> +	AX25_STATE_3,			/* Established */
    +  AX25_STATE_ESTABLISHED = AX25_STATE_3,
> +	AX25_STATE_4			/* Recovery */
    +  AX25_STATE_RECOVERY = AX25_STATE_4,
>  };

That would not break backward compatibility and now the state machine can be
self explanatory :-)

Regards

Ingo Oeser