From patchwork Thu Dec 11 03:02:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiejun Chen X-Patchwork-Id: 5473841 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DA20B9F2E8 for ; Thu, 11 Dec 2014 03:04:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ECC5620172 for ; Thu, 11 Dec 2014 03:04:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EF99920166 for ; Thu, 11 Dec 2014 03:04:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933548AbaLKDEo (ORCPT ); Wed, 10 Dec 2014 22:04:44 -0500 Received: from mga02.intel.com ([134.134.136.20]:48911 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933176AbaLKDEn (ORCPT ); Wed, 10 Dec 2014 22:04:43 -0500 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 10 Dec 2014 19:04:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,691,1406617200"; d="scan'208";a="497014809" Received: from tchen0-linux.bj.intel.com ([10.238.135.72]) by orsmga003.jf.intel.com with ESMTP; 10 Dec 2014 19:00:44 -0800 From: Tiejun Chen To: pbonzini@redhat.com Cc: kvm@vger.kernel.org Subject: [PATCH] kvm: coalesced_mmio: remove one redundant check inside of coalesced_mmio_in_range() Date: Thu, 11 Dec 2014 11:02:41 +0800 Message-Id: <1418266961-27277-1-git-send-email-tiejun.chen@intel.com> X-Mailer: git-send-email 1.9.1 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We already check 'len' above to make sure it already isn't negative here, so indeed, (addr + len < addr) should never be happened. Signed-off-by: Tiejun Chen --- virt/kvm/coalesced_mmio.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/virt/kvm/coalesced_mmio.c b/virt/kvm/coalesced_mmio.c index 00d8642..60f59cd 100644 --- a/virt/kvm/coalesced_mmio.c +++ b/virt/kvm/coalesced_mmio.c @@ -30,8 +30,6 @@ static int coalesced_mmio_in_range(struct kvm_coalesced_mmio_dev *dev, */ if (len < 0) return 0; - if (addr + len < addr) - return 0; if (addr < dev->zone.addr) return 0; if (addr + len > dev->zone.addr + dev->zone.size)