linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu@kernel.org>
To: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Cc: kys@microsoft.com, haiyangz@microsoft.com,
	sthemmin@microsoft.com, wei.liu@kernel.org,
	linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hv_balloon: Remove redundant assignment to region_start
Date: Tue, 4 May 2021 12:54:47 +0000	[thread overview]
Message-ID: <20210504125447.wy5e6kar7u5kvc2v@liuwe-devbox-debian-v2> (raw)
In-Reply-To: <1619691681-86256-1-git-send-email-jiapeng.chong@linux.alibaba.com>

On Thu, Apr 29, 2021 at 06:21:21PM +0800, Jiapeng Chong wrote:
> Variable region_start is set to pg_start but this value is never
> read as it is overwritten later on, hence it is a redundant
> assignment and can be removed.

Indeed. It is overwritten a few lines below.

> 
> Cleans up the following clang-analyzer warning:
> 
> drivers/hv/hv_balloon.c:1013:3: warning: Value stored to 'region_start'
> is never read [clang-analyzer-deadcode.DeadStores].
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>

Applied to hyperv-next. Thanks.

Wei.

> ---
>  drivers/hv/hv_balloon.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
> index 58af84e..7f11ea0 100644
> --- a/drivers/hv/hv_balloon.c
> +++ b/drivers/hv/hv_balloon.c
> @@ -1010,7 +1010,6 @@ static void hot_add_req(struct work_struct *dummy)
>  		 * that need to be hot-added while ensuring the alignment
>  		 * and size requirements of Linux as it relates to hot-add.
>  		 */
> -		region_start = pg_start;
>  		region_size = (pfn_cnt / HA_CHUNK) * HA_CHUNK;
>  		if (pfn_cnt % HA_CHUNK)
>  			region_size += HA_CHUNK;
> -- 
> 1.8.3.1
> 

      reply	other threads:[~2021-05-04 12:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-29 10:21 [PATCH] hv_balloon: Remove redundant assignment to region_start Jiapeng Chong
2021-05-04 12:54 ` Wei Liu [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=20210504125447.wy5e6kar7u5kvc2v@liuwe-devbox-debian-v2 \
    --to=wei.liu@kernel.org \
    --cc=haiyangz@microsoft.com \
    --cc=jiapeng.chong@linux.alibaba.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sthemmin@microsoft.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;
as well as URLs for NNTP newsgroup(s).