From patchwork Fri Nov 16 06:50:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 12891 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id B708523E13 for ; Fri, 16 Nov 2012 06:57:24 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 6B6B1A19389 for ; Fri, 16 Nov 2012 06:57:24 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id f6so1430377iag.11 for ; Thu, 15 Nov 2012 22:57:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=8yH5qS1oFroUW7Mo5h9czFq3lYMIRi+URgRadlXp2HM=; b=DVG4ntN05Sg7yjY7InACg54NZm8nWs8YAtDPYplZLrouU/iYwg7vKM9cEVH7cZP0On /+2p4R2iOfSKARK4ULdUNoK7GFUQ05NRFhTwBjAitH8v6USPDYQGR6x6L2li37eYB9VH +cleN2q/q1DgGpDbL1rrc51l5Ub9tG42XKL0L6Wx5Vmul3VOZ0/6Qw63q/u2NC5NkYbr OopkY4IkUnrZWYI6mvUiT2O+oa+X96m7z7NU7O8py3H/uDcLZGLTjeCQ7hjLfOTTexcV 9NlzRp7+0PntmOAKqIajsFoWbI2KbksrxFjrF7cPzXXSXeCzk10PPzY+Ki5zJjtaSnJq URkg== Received: by 10.43.125.133 with SMTP id gs5mr2906822icc.54.1353049044206; Thu, 15 Nov 2012 22:57:24 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp23358igt; Thu, 15 Nov 2012 22:57:23 -0800 (PST) Received: by 10.68.138.229 with SMTP id qt5mr11984537pbb.122.1353049043757; Thu, 15 Nov 2012 22:57:23 -0800 (PST) Received: from mail-pb0-f46.google.com (mail-pb0-f46.google.com [209.85.160.46]) by mx.google.com with ESMTPS id bc7si1147827pab.152.2012.11.15.22.57.23 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Nov 2012 22:57:23 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.46 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.160.46; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.46 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) smtp.mail=tushar.behera@linaro.org Received: by mail-pb0-f46.google.com with SMTP id wy7so1781600pbc.5 for ; Thu, 15 Nov 2012 22:57:23 -0800 (PST) Received: by 10.68.231.3 with SMTP id tc3mr12178530pbc.89.1353049043455; Thu, 15 Nov 2012 22:57:23 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id mz10sm753915pbc.37.2012.11.15.22.57.19 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Nov 2012 22:57:22 -0800 (PST) From: Tushar Behera To: linux-kernel@vger.kernel.org Cc: patches@linaro.org, Ian Campbell , xen-devel@lists.xensource.com, netdev@vger.kernel.org Subject: [PATCH 08/14] xen: netback: Remove redundant check on unsigned variable Date: Fri, 16 Nov 2012 12:20:40 +0530 Message-Id: <1353048646-10935-9-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1353048646-10935-1-git-send-email-tushar.behera@linaro.org> References: <1353048646-10935-1-git-send-email-tushar.behera@linaro.org> X-Gm-Message-State: ALoCoQms/w9MO6AR2X5aNt5uYEZnalGd/he6K25gKgpY53NtdkNlMsQ83c85O/QJE+BEyuPqAfyM No need to check whether unsigned variable is less than 0. CC: Ian Campbell CC: xen-devel@lists.xensource.com CC: netdev@vger.kernel.org Signed-off-by: Tushar Behera Acked-by: Ian Campbell --- drivers/net/xen-netback/netback.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c index aab8677..515e10c 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c @@ -190,14 +190,14 @@ static int get_page_ext(struct page *pg, group = ext.e.group - 1; - if (group < 0 || group >= xen_netbk_group_nr) + if (group >= xen_netbk_group_nr) return 0; netbk = &xen_netbk[group]; idx = ext.e.idx; - if ((idx < 0) || (idx >= MAX_PENDING_REQS)) + if (idx >= MAX_PENDING_REQS) return 0; if (netbk->mmap_pages[idx] != pg)