From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756242AbdJRLwR (ORCPT ); Wed, 18 Oct 2017 07:52:17 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:37096 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754212AbdJRLwQ (ORCPT ); Wed, 18 Oct 2017 07:52:16 -0400 From: Colin King To: "K . Y . Srinivasan" , Haiyang Zhang , Stephen Hemminger , devel@linuxdriverproject.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] drivers: hv: balloon: remove extraneous assignment to region_start Date: Wed, 18 Oct 2017 12:52:12 +0100 Message-Id: <20171018115212.29111-1-colin.king@canonical.com> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King The variable region_start is assigned twice, the first value is never read and redundant, so can be removed. We can clean up the code further by assigning rg_start directly rather than using the temporary variable region_start which can then be removed. Cleans up the clang warning: drivers/hv/hv_balloon.c:976:3: warning: Value stored to 'region_start' is never read Signed-off-by: Colin Ian King --- drivers/hv/hv_balloon.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c index db0e6652d7ef..54e1ab3d5bad 100644 --- a/drivers/hv/hv_balloon.c +++ b/drivers/hv/hv_balloon.c @@ -964,7 +964,6 @@ static void hot_add_req(struct work_struct *dummy) if ((rg_start == 0) && (!dm->host_specified_ha_region)) { unsigned long region_size; - unsigned long region_start; /* * The host has not specified the hot-add region. @@ -973,14 +972,11 @@ 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; - region_start = (pg_start / HA_CHUNK) * HA_CHUNK; - - rg_start = region_start; + rg_start = (pg_start / HA_CHUNK) * HA_CHUNK; rg_sz = region_size; } -- 2.14.1