From patchwork Sun Dec 9 11:37:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Garrett Cooper X-Patchwork-Id: 1853701 X-Patchwork-Delegate: alexne@voltaire.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 7E54FDF215 for ; Sun, 9 Dec 2012 11:37:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933902Ab2LILhN (ORCPT ); Sun, 9 Dec 2012 06:37:13 -0500 Received: from mail-da0-f46.google.com ([209.85.210.46]:37445 "EHLO mail-da0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933438Ab2LILhN (ORCPT ); Sun, 9 Dec 2012 06:37:13 -0500 Received: by mail-da0-f46.google.com with SMTP id p5so837143dak.19 for ; Sun, 09 Dec 2012 03:37:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:user-agent:mime-version :content-type; bh=4QP+jluG3x4gvVCRUgMOPlxD6M/Mb0+MD6TxY8xdHQs=; b=rCVFCRnRJElYLZPWEQK6xBIZqBCikDOAj0ZbvuOKu2Z5hkimP3GUN3Tf0JfE39RCIz jY0hHMdOa6hqMOJHOOyZU1CcaaiJIaHTO63CO4jAbh74drrSE0hQqSL1VKGtkw0VZ8NH sqTM61Kz8Q3U5bN73yBWRjzY1JXQBAysTu8BFtoZU+UPz9Gl8hEmBbHbiwDaUXmIsInu 1oFNG6NPFGvGsGmxNmIrvALOADjCHUv9uZxRmAubQQitbsYOfN3dSOvpeb/MZq5sYzOs qx3DR87h4RkKkP3PIXPOmzgObfF275pP4trQzMGgXvpCNv7a7bbHAa9Z3j8wMwOwXR8f 1sCA== Received: by 10.68.232.200 with SMTP id tq8mr30279775pbc.52.1355053032691; Sun, 09 Dec 2012 03:37:12 -0800 (PST) Received: from c-24-19-191-56.hsd1.wa.comcast.net (c-24-19-191-56.hsd1.wa.comcast.net. [24.19.191.56]) by mx.google.com with ESMTPS id un16sm9960183pbc.47.2012.12.09.03.37.11 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 09 Dec 2012 03:37:12 -0800 (PST) Date: Sun, 9 Dec 2012 03:37:07 -0800 (PST) From: Garrett Cooper To: linux-rdma@vger.kernel.org Subject: [PATCH] Fix -Wtautological-compare warnings with clang Message-ID: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Signed-off-by: Garrett Cooper --- src/ibportstate.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ibportstate.c b/src/ibportstate.c index 1d8dc81..9d90615 100644 --- a/src/ibportstate.c +++ b/src/ibportstate.c @@ -438,19 +438,19 @@ int main(int argc, char **argv) val = strtoull(argv[i], 0, 0); switch (j) { case SPEED: - if (val < 0 || val > 15) + if (val > 15) IBERROR("invalid speed value %ld", val); break; case ESPEED: - if (val < 0 || val > 31) + if (val > 31) IBERROR("invalid extended speed value %ld", val); break; case FDR10SPEED: - if (val < 0 || val > 1) + if (val > 1) IBERROR("invalid fdr10 speed value %ld", val); break; case WIDTH: - if (val < 0 || (val > 15 && val != 255)) + if (val > 15 && val != 255) IBERROR("invalid width value %ld", val); break; case VLS: @@ -471,7 +471,7 @@ int main(int argc, char **argv) val); break; case LMC: - if (val < 0 || val > 7) + if (val > 7) IBERROR("invalid lmc value %ld", val); break; case MKEY: @@ -488,11 +488,11 @@ int main(int argc, char **argv) /* All 64-bit values are legal */ break; case MKEYLEASE: - if (val < 0 || val > 0xFFFF) + if (val > 0xFFFF) IBERROR("invalid mkey lease time %ld", val); break; case MKEYPROT: - if (val < 0 || val > 3) + if (val > 3) IBERROR("invalid mkey protection bit setting %ld", val); } *port_args[j].val = val;