All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: iwd@lists.01.org
Subject: Re: [PATCH 1/2] eap: avoid nested functions
Date: Mon, 17 May 2021 10:42:47 -0500	[thread overview]
Message-ID: <8bc27907-7f25-65d0-1ffd-75f6c4029a56@gmail.com> (raw)
In-Reply-To: <20210514163414.304860-1-Marc-Antoine@Perennou.com>

[-- Attachment #1: Type: text/plain, Size: 1343 bytes --]

Hi Marc-Antoine,

On 5/14/21 11:34 AM, Marc-Antoine Perennou wrote:
> Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>

No Signed-off-by please

> ---
>   src/eap.c | 10 ++--------
>   1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/src/eap.c b/src/eap.c
> index 0645be47..53e35b5e 100644
> --- a/src/eap.c
> +++ b/src/eap.c
> @@ -416,6 +416,8 @@ static const char *eap_type_to_str(enum eap_type type, uint32_t vendor_id,
>   #define IS_EXPANDED_RESPONSE(id, t) \
>   	(type == EAP_TYPE_EXPANDED && vendor_id == (id) && vendor_type == (t))
>   
> +#define response_is(wanted) ((type == wanted) || IS_EXPANDED_RESPONSE(0, 

Would it be safer to add '()' around wanted in at least the type == comparison?

wanted))
> +
>   static void eap_handle_response(struct eap_state *eap, const uint8_t *pkt,
>   				size_t len)
>   {
> @@ -428,14 +430,6 @@ static void eap_handle_response(struct eap_state *eap, const uint8_t *pkt,
>   				eap->method->vendor_id[2];
>   	uint32_t our_vendor_type = eap->method->vendor_type;
>   
> -	bool response_is(enum eap_type wanted)
> -	{
> -		if (type == wanted)
> -			return true;
> -
> -		return IS_EXPANDED_RESPONSE(0, wanted);
> -	}
> -
>   	if (len < 1)
>   		/* Invalid packets to be ignored */
>   		return;
> 

Regards,
-Denis

      parent reply	other threads:[~2021-05-17 15:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-14 16:34 [PATCH 1/2] eap: avoid nested functions Marc-Antoine Perennou
2021-05-14 16:34 ` [PATCH 2/2] ap: update for new _auto_ destructors Marc-Antoine Perennou
2021-05-14 16:35   ` keruspe+ml01
2021-05-17 15:42 ` Denis Kenzior [this message]

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=8bc27907-7f25-65d0-1ffd-75f6c4029a56@gmail.com \
    --to=denkenz@gmail.com \
    --cc=iwd@lists.01.org \
    /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.