From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5AF28C76186 for ; Wed, 24 Jul 2019 19:32:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2DA81229FA for ; Wed, 24 Jul 2019 19:32:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="kqZlOYO6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388595AbfGXTcG (ORCPT ); Wed, 24 Jul 2019 15:32:06 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:43147 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388573AbfGXTcA (ORCPT ); Wed, 24 Jul 2019 15:32:00 -0400 Received: by mail-qk1-f195.google.com with SMTP id m14so8965694qka.10 for ; Wed, 24 Jul 2019 12:31:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=JInymQc+r2pImT3B/SmMJqhNX9Hf0EsstZD4VE2LjQM=; b=kqZlOYO69x/UMTO3KbfUun+RUej+Y76S6n3UnFY6G3wqJzkvqWxwRxlpmvMwx+lWQp 5P9Ndi1/9ULn3zbXOvj43rZB0qedEiDhjIQyLZpqiO5jWvvjUpbuSLTz6gw40pIyuntD cggriFRIBnzO0dFwBsK1LW9AG+oSsbnKRqd9uBFaiBHzjjfM7TJVfClTjmOZ8ugBiuap e+wEr5Hxo0frnDbySkZTeLae0KrjbsyVtLi40YtQfm//ENZepIaOs2io14Ncx3Had2jj BXr+eLZ5gyA77h7uoSpLFR7S/AV7V7Gd6/I2q8XVXeVOcxH6jFEGqEsXWRMTP5SwFtzV 786A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=JInymQc+r2pImT3B/SmMJqhNX9Hf0EsstZD4VE2LjQM=; b=oYzUu6pbbrYWYPcLJTrwZSZmEeeInDehy9qCaUNuStcqSDUlkAyZjCQ28sMq6SGEi+ br3KktILLtAGsbYe6GWpijHm9cpUOFS+6Y7tL/YCjm2RD2W27/PKQ22lcBZjmA9z3SxX uBBtOSckNwJNEdNt1BFbiXkYn2erQvIoIHAEQFe/Ic7XBTpqODdobcG1ImhE+Io/x0Q1 KxIHRtvypBci41vm9BAlLCyc9FPzhxgM2e+xcUYEpNI3XUS1RkwohrhURk2BW02AzvX4 qQ5R+fC87ecwKitU7y+uS6flzl1VPiASptbtiJyb5UX/rrwrqPaHW8/ytZNlRKLQwRmO t7IA== X-Gm-Message-State: APjAAAW2MYMpD1ahbmGH8JP0f8qETgZldeETOlHu/eXoe957PwSfrjbR 0ZHJUwXt9ux5liMR7U6XK0y3MQ== X-Google-Smtp-Source: APXvYqxLDN1MDxYfhjO8ggCE8CbyvO+EWhy5R2UY8hExLnegRMJl96uiWmL/0ruwscoK42+uMywHnw== X-Received: by 2002:a37:7604:: with SMTP id r4mr53902933qkc.395.1563996718992; Wed, 24 Jul 2019 12:31:58 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-55-100.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.55.100]) by smtp.gmail.com with ESMTPSA id u4sm21157159qkb.16.2019.07.24.12.31.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Jul 2019 12:31:58 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hqMzW-0001jO-03; Wed, 24 Jul 2019 16:31:58 -0300 Date: Wed, 24 Jul 2019 16:31:57 -0300 From: Jason Gunthorpe To: Colin King Cc: Lijun Ou , Wei Hu , Doug Ledford , linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2][next] RDMA/hns: fix comparison of unsigned long variable 'end' with less than zero Message-ID: <20190724193157.GA6620@ziepe.ca> References: <20190531092101.28772-1-colin.king@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190531092101.28772-1-colin.king@canonical.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 31, 2019 at 10:21:00AM +0100, Colin King wrote: > From: Colin Ian King > > Currently the comparison of end with less than zero is always false > because end is an unsigned long. Also, replace checks of end with > non-zero with end > 0 as it is possible that the #defined decrement > may be changed in the future causing end to step over zero and go > negative. > > The initialization of end with 0 is also redundant as this value is > never read and is later set to HW_SYNC_TIMEOUT_MSECS, so fix this by > initializing it with this value to begin with. > > Addresses-Coverity: ("Unsigned compared against 0") > Fixes: 669cefb654cb ("RDMA/hns: Remove jiffies operation in disable interrupt context") > Signed-off-by: Colin Ian King > --- > drivers/infiniband/hw/hns/hns_roce_hem.c | 4 ++-- > drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 12 ++++++------ > 2 files changed, 8 insertions(+), 8 deletions(-) Applied to for-next, thanks Jason