public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <elder@ieee.org>
To: Colin Ian King <colin.i.king@gmail.com>,
	Alex Elder <elder@kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] net: ipa: remove the redundant assignment to variable trans_id
Date: Tue, 16 Jan 2024 05:44:48 -0600	[thread overview]
Message-ID: <51e73530-7c65-4e2f-9749-7dbbe9098fde@ieee.org> (raw)
In-Reply-To: <20240116114025.2264839-1-colin.i.king@gmail.com>

On 1/16/24 5:40 AM, Colin Ian King wrote:
> The variable trans_id is being modulo'd by channel->tre_count and
> the value is being re-assigned back to trans_id even though the
> variable is not used after this operation. The assignment is
> redundant. Remove the assignment and just replace it with the modulo
> operator.
> 
> Cleans up clang scan build warning:
> warning: Although the value stored to 'trans_id' is used in the
> enclosing expression, the value is never actually read from
> 'trans_id' [deadcode.DeadStores]
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

This looks good.  I saw this before but hadn't gotten around to
fixing it yet.  Thank you!

Reviewed-by: Alex Elder <elder@linaro.org>

> ---
>   drivers/net/ipa/gsi_trans.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ipa/gsi_trans.c b/drivers/net/ipa/gsi_trans.c
> index ee6fb00b71eb..f5dafc2f53ab 100644
> --- a/drivers/net/ipa/gsi_trans.c
> +++ b/drivers/net/ipa/gsi_trans.c
> @@ -247,7 +247,7 @@ struct gsi_trans *gsi_channel_trans_complete(struct gsi_channel *channel)
>   			return NULL;
>   	}
>   
> -	return &trans_info->trans[trans_id %= channel->tre_count];
> +	return &trans_info->trans[trans_id % channel->tre_count];
>   }
>   
>   /* Move a transaction from allocated to committed state */


  reply	other threads:[~2024-01-16 11:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-16 11:40 [PATCH][next] net: ipa: remove the redundant assignment to variable trans_id Colin Ian King
2024-01-16 11:44 ` Alex Elder [this message]
2024-01-16 19:31 ` Simon Horman
2024-01-26 15:15   ` Alex Elder

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=51e73530-7c65-4e2f-9749-7dbbe9098fde@ieee.org \
    --to=elder@ieee.org \
    --cc=colin.i.king@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=elder@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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