From patchwork Thu Jun 9 16:02:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongli Zhang X-Patchwork-Id: 9167369 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D938960467 for ; Thu, 9 Jun 2016 16:04:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB8B020855 for ; Thu, 9 Jun 2016 16:04:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C02DB27248; Thu, 9 Jun 2016 16:04:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7539020855 for ; Thu, 9 Jun 2016 16:04:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bB2Pl-0002UX-9d; Thu, 09 Jun 2016 16:02:37 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bB2Pk-0002UN-5o for xen-devel@lists.xen.org; Thu, 09 Jun 2016 16:02:36 +0000 Received: from [85.158.143.35] by server-3.bemta-6.messagelabs.com id CB/4F-25713-B1399575; Thu, 09 Jun 2016 16:02:35 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMLMWRWlGSWpSXmKPExsUyZ7p8oK705Mh wgzmd3BZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8bhiWcZC1axVXw69YC5gbGVtYuRi0NIoJ1J 4mv3AijnK6NE956vQA4nkLOBUeLQVk2IRDejxP+u0ywgCTYBHYlpB06xgCREBNoYJRZMucvcx cjBISwQLTGntwSkhkVAVeLO7m+MIDavgLvEg5+X2UFsCQE5iZPHJrNC2MYS7W8vsk1g5F7AyL CKUb04tagstUjXWC+pKDM9oyQ3MTNH19DATC83tbg4MT01JzGpWC85P3cTI9DDDECwg7Hjn9M hRkkOJiVRXsGeyHAhvqT8lMqMxOKM+KLSnNTiQ4wyHBxKErwSk4BygkWp6akVaZk5wFCDSUtw 8CiJ8F6YCJTmLS5IzC3OTIdInWLU5Vjw4/ZaJiGWvPy8VClx3l0gRQIgRRmleXAjYGF/iVFWS piXEegoIZ6C1KLczBJU+VeM4hyMSsK8siCX8GTmlcBtegV0BBPQEcuPhIMcUZKIkJJqYFTfJP 1PRVgzcNPbKl7NrJmxHWpqfY2/+PyEhG0SeByNnzffl+84sXTylu2XpDwuK1+6saxp4/FL3zw WGyYe8My6+W69xvXZT8+/vP/eZ7pzbP5CzQcMqgd33nNPqrTbtMjj6aodpw8fs+b+cHBHulmr VgvrzjdsOhkiZ7l+MTI8Ve43qjy9olmJpTgj0VCLuag4EQBv96THdgIAAA== X-Env-Sender: dongli.zhang@oracle.com X-Msg-Ref: server-6.tower-21.messagelabs.com!1465488153!18158926!1 X-Originating-IP: [156.151.31.81] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAyODgzMzk=\n X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 20724 invoked from network); 9 Jun 2016 16:02:34 -0000 Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by server-6.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 9 Jun 2016 16:02:34 -0000 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u59G2Sri005604 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 9 Jun 2016 16:02:29 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u59G2Ssr018578 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 9 Jun 2016 16:02:28 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u59G2RaJ011459; Thu, 9 Jun 2016 16:02:27 GMT Received: from linux.cn.oracle.com (/10.182.70.252) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 09 Jun 2016 09:02:27 -0700 From: Dongli Zhang To: xen-devel@lists.xen.org, konrad.wilk@oracle.com, ross.lagerwall@citrix.com, ian.jackson@eu.citrix.com, wei.liu2@citrix.com Date: Fri, 10 Jun 2016 00:02:52 +0800 Message-Id: <1465488172-29775-1-git-send-email-dongli.zhang@oracle.com> X-Mailer: git-send-email 1.9.1 X-Source-IP: aserv0022.oracle.com [141.146.126.234] Subject: [Xen-devel] [PATCH 1/1] tools/livepatch: cleanup unnecessary "j = ARRAY_SIZE(action_options); " X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Local variable "j" would be used only when "i == ARRAY_SIZE(main_options)" is true. Thus, it is not necessary to update "j" when "i == ARRAY_SIZE(main_options)" is false. Signed-off-by: Dongli Zhang Reviewed-by: Konrad Rzeszutek Wilk --- tools/misc/xen-livepatch.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/misc/xen-livepatch.c b/tools/misc/xen-livepatch.c index 28f339a..3162489 100644 --- a/tools/misc/xen-livepatch.c +++ b/tools/misc/xen-livepatch.c @@ -435,8 +435,7 @@ int main(int argc, char *argv[]) "'xen-livepatch help'\n", argv[1]); return 1; } - } else - j = ARRAY_SIZE(action_options); + } xch = xc_interface_open(0,0,0); if ( !xch )