All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Schmidt <stefan@datenfreihafen.org>
To: Yang Li <yang.lee@linux.alibaba.com>, alex.aring@gmail.com
Cc: davem@davemloft.net, kuba@kernel.org, linux-wpan@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net/ieee802154: drop unneeded assignment in llsec_iter_devkeys()
Date: Thu, 3 Jun 2021 10:21:09 +0200	[thread overview]
Message-ID: <6bffca3c-6c85-b975-24d4-cdd1aa47380e@datenfreihafen.org> (raw)
In-Reply-To: <1619346299-40237-1-git-send-email-yang.lee@linux.alibaba.com>

Hello.

On 25.04.21 12:24, Yang Li wrote:
> In order to keep the code style consistency of the whole file,
> redundant return value ‘rc’ and its assignments should be deleted
> 
> The clang_analyzer complains as follows:
> net/ieee802154/nl-mac.c:1203:12: warning: Although the value stored to
> 'rc' is used in the enclosing expression, the value is never actually
> read from 'rc'
> 
> No functional change, only more efficient.
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
>   net/ieee802154/nl-mac.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/net/ieee802154/nl-mac.c b/net/ieee802154/nl-mac.c
> index 0c1b077..a6a8cf6 100644
> --- a/net/ieee802154/nl-mac.c
> +++ b/net/ieee802154/nl-mac.c
> @@ -1184,7 +1184,7 @@ static int llsec_iter_devkeys(struct llsec_dump_data *data)
>   {
>   	struct ieee802154_llsec_device *dpos;
>   	struct ieee802154_llsec_device_key *kpos;
> -	int rc = 0, idx = 0, idx2;
> +	int idx = 0, idx2;
>   
>   	list_for_each_entry(dpos, &data->table->devices, list) {
>   		if (idx++ < data->s_idx)
> @@ -1200,7 +1200,7 @@ static int llsec_iter_devkeys(struct llsec_dump_data *data)
>   						      data->nlmsg_seq,
>   						      dpos->hwaddr, kpos,
>   						      data->dev)) {
> -				return rc = -EMSGSIZE;
> +				return -EMSGSIZE;
>   			}
>   
>   			data->s_idx2++;
> @@ -1209,7 +1209,7 @@ static int llsec_iter_devkeys(struct llsec_dump_data *data)
>   		data->s_idx++;
>   	}
>   
> -	return rc;
> +	return 0;
>   }
>   
>   int ieee802154_llsec_dump_devkeys(struct sk_buff *skb,
> 

This patch has been applied to the wpan tree and will be
part of the next pull request to net. Thanks!

regards
Stefan Schmidt

      reply	other threads:[~2021-06-03  8:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-25 10:24 [PATCH] net/ieee802154: drop unneeded assignment in llsec_iter_devkeys() Yang Li
2021-06-03  8:21 ` Stefan Schmidt [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=6bffca3c-6c85-b975-24d4-cdd1aa47380e@datenfreihafen.org \
    --to=stefan@datenfreihafen.org \
    --cc=alex.aring@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wpan@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=yang.lee@linux.alibaba.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.