Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9931682ybi; Wed, 24 Jul 2019 12:33:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/I+VTEi/pQG+gtUO2QIE2WCad6dm/UzzN8NlRwZgJEtJHWuQtfUmT26VwNJIGRD6DrLnZ X-Received: by 2002:a17:90a:8c90:: with SMTP id b16mr88400737pjo.133.1563996795164; Wed, 24 Jul 2019 12:33:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563996795; cv=none; d=google.com; s=arc-20160816; b=weo263pBsMQ0uCGmwB4iNpX8mCDBIKy3tYmC4ZohxK9KmU8vvJfpMxOEuTWRIeeHFp kUtMvRV5ztdNAcNebzaJns7htpHJtRV68P5w264zo0sXdrkgzhfsqUNh3YrhnE4q46ko H/q42tb5PZA+6jdjFnZaMkXgvbP5vJNRvgXxFvJJXvLvntbPKqchtJwLXlL59ns+sCBn ncPnZk9EPamDeryAKj3l7VC/GftLjYVDnVjFBeSOtSHcZHbSM6gHyDOhmZ8udD/QtoWp UE6FeJY56/uhHb3QlH1bCu8Tk9kcClGzS2s9FT1shUZKt1S/A2VUyHcG1F1y9cRVIJhZ P/5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=JInymQc+r2pImT3B/SmMJqhNX9Hf0EsstZD4VE2LjQM=; b=Q7//k/rbJF0vxhwaZ2abdgkHk2rJfEH619OoRjHx3x00V2y7rFX/vdMK80PmzJ2CH/ 1OG5oeDvIiMjv/7lj/20in15VwYpxHxa8Y0XVMlXsa5E2Dd4CTjgg/fO1W9GG1bq182s /b2iGfZsoCD9tUHgoPqTcDovwHJ7ZTIhR5521IeoyISYE3SLkMxbVReGI7obhTyya76I 0GeTY8tQdiqWr5Ds1SVuPwP3ODSj3sEwlpb4tYhbAg2Io7eaTufKr97vtwg2fsjEeaJl gI+1qHhyJKY5MwPKvzczX2U4CZZWaUMbhAOFuV/KrtCrBE9vVCL/rbTnraZv47MoWc5G gz8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=kqZlOYO6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l186si16944701pgd.455.2019.07.24.12.33.00; Wed, 24 Jul 2019 12:33:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=kqZlOYO6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388591AbfGXTcF (ORCPT + 99 others); Wed, 24 Jul 2019 15:32:05 -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-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