Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3065216rwd; Mon, 22 May 2023 08:11:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4sUkaQ4Yepqowao+TZX/7BN6VgXuJqQWmcb664J1et8YUUnWuG6etVUP/xUhdvL7eiISjN X-Received: by 2002:a17:90a:fa8f:b0:24e:3b69:a87f with SMTP id cu15-20020a17090afa8f00b0024e3b69a87fmr10957702pjb.25.1684768313859; Mon, 22 May 2023 08:11:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684768313; cv=none; d=google.com; s=arc-20160816; b=KMUmBNtl8L32cFGNzIxgjqIJ7I+bWT3YXdIsW/LT6bxJAzOiuIGlDXFvwsGYUwQkdV tVG3QWDacjksgjFDOx8puiqNcYBdQxkxy1vVlbgQtRQ4UI9yp4y7KHtZWMr5WNLVZLWx JwvdSfysBXRKqe0p+IfT8WlZMunhgYzYBvhVkpKwV57NutkLu9Dgnf2waZBM3a9m8q1w nl14i21hrd5yaZOKuHYSO1JYBOF6YGsOUyVjcBI2QRb0NJJYm9tlj2vUYV8ccgVXC8fZ 5nSa7XwJbZLGz749Z2PLfjU93GLlyE4rwvG2YytmaNQdhmJl+/WPOkbUOgFWmFXfwnAD wAhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=l9+Z/yo/990FPPh1vM0WhcUYxVkl6LMnyPg5rFTfhAY=; b=o+WKGHa/K6IhAncwxP5xWAw17sMyCuDmc7EHB3TWx9ol/NhiJ0g9dFrNm4PCodqbCp REPeTI+h+YP50xnvvR5ACmY/dCXjTG3/LcwbVZe2pWWH8+/VTpfB6QNzIh9ZSLldyxic tVm6zF1SRhDZ9K1tDcXfnnxS6At6gmsY9WU0K1TjVXmC/lUcsRyL1WiJugaXf0arEus8 qKuuEaP0yba0u4U2KN+BW1Kr1MmCs3beR4CoXEvjsCwnxQ1Jc0C2uxO4SJKb+BM2cHEa /9DBOaYCtXECxU4FEXCS6i3I1Rqidw3/WJ78/SI6nCrjxYb8jy7av7DJr8nZpaGK6FW+ HRcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=oC+ddbUe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pf6-20020a17090b1d8600b0025346cf794dsi378640pjb.134.2023.05.22.08.11.40; Mon, 22 May 2023 08:11:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=oC+ddbUe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234451AbjEVPDa (ORCPT + 99 others); Mon, 22 May 2023 11:03:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234098AbjEVPDN (ORCPT ); Mon, 22 May 2023 11:03:13 -0400 Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04E8F10D3; Mon, 22 May 2023 08:02:39 -0700 (PDT) Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-397fe20a2b5so437669b6e.3; Mon, 22 May 2023 08:02:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684767756; x=1687359756; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=l9+Z/yo/990FPPh1vM0WhcUYxVkl6LMnyPg5rFTfhAY=; b=oC+ddbUeJBq0b9XNhZ2dJmn6tG665zNZ21gthPPJvPvZJNfEuCpE4hfp7iJu4EM+5K 7M+hg2Zbnrae9ugnC4AE3qM3JjDAgwYY3mVWUPvKudlsZZa5ng+QVoOzzJZxfzc4seAk Gwuv2jDItPCzIbIoFNii0/Iolc8vspBvcukjrgOh32ZBo6B0aXs+cT3aZbqSNg53xUxK 7fFqCQazjUTzSFH6I2XSGQfAXxDz+3vWDxWKDTYYTsgCZnAX16yU/FsvZGvD7zRoOEhK 2ffXfbT0JXROF8unVfKSleowQHrNdA4+VcR7Pymo/YlIPVoKrDwByyiodz0yZ5Ho7HAS 1WiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684767756; x=1687359756; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=l9+Z/yo/990FPPh1vM0WhcUYxVkl6LMnyPg5rFTfhAY=; b=ESoYcCW8xbfOxO/uOcsrJgmfVoyfRuEbTUgj59hRu3vg3hmvenX96UFU5x7YvbwxRc DAXDJrpRHiijOyvKONAkm9YyeYodmVhNL5hPGU1xebSE65D1QMhXbX+McgRtYGKyex0V l2TdHHYONBqfH/Ad/C7SKxHbPISYhVXA6Jd748flOBtpCM2r6N2NCvrg/ROXbVfVE19h J0kAFT+RYFWtduyv9KEaYodu2EIbYIqYt8KtHLhsmdoDZxht/1T1BBtQx2zdlf3lkt65 AUKfrtBCVp6W0Ahwp/J527+LaHtngjCFbxz3auTykZEG3/sCJC00fJSdjXhAlzGTyMj8 dPXg== X-Gm-Message-State: AC+VfDyHQUCr9uqc4UKpQRT6PFGFL0qOO402EoOkVjjb0yZW5CL/tY+t 4rRmkYcCmvgStd+Kvh3XEb0/voUNZQ3ADmM4d+s= X-Received: by 2002:a05:6808:613:b0:396:2bbe:b0c0 with SMTP id y19-20020a056808061300b003962bbeb0c0mr5773273oih.18.1684767756342; Mon, 22 May 2023 08:02:36 -0700 (PDT) MIME-Version: 1.0 References: <20230522073017.1782984-1-harshit.m.mogalapalli@oracle.com> In-Reply-To: <20230522073017.1782984-1-harshit.m.mogalapalli@oracle.com> From: Alex Deucher Date: Mon, 22 May 2023 11:02:25 -0400 Message-ID: Subject: Re: [PATCH next] drm/amdgpu: Fix unsigned comparison with zero in gmc_v9_0_process_interrupt() To: Harshit Mogalapalli Cc: Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter , Felix Kuehling , Hawking Zhang , Le Ma , Lijo Lazar , Mukul Joshi , Rajneesh Bhardwaj , Graham Sider , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, dan.carpenter@linaro.org, kernel-janitors@vger.kernel.org, error27@gmail.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Applied. Thanks! On Mon, May 22, 2023 at 3:30=E2=80=AFAM Harshit Mogalapalli wrote: > > Smatch warns: > drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c:579: > unsigned 'xcc_id' is never less than zero. > > gfx_v9_4_3_ih_to_xcc_inst() returns negative numbers as well. > Fix this by changing type of xcc_id to int. > > Fixes: faf96b9b602d ("drm/amdgpu: correct the vmhub index when page fault= occurs") > Signed-off-by: Harshit Mogalapalli > --- > This is from static analysis, only compile tested. > --- > drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/= amdgpu/gmc_v9_0.c > index f70e666cecf2..1e8b2aaa48c1 100644 > --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c > +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c > @@ -557,8 +557,8 @@ static int gmc_v9_0_process_interrupt(struct amdgpu_d= evice *adev, > const char *hub_name; > u64 addr; > uint32_t cam_index =3D 0; > - int ret; > - uint32_t node_id, xcc_id =3D 0; > + int ret, xcc_id =3D 0; > + uint32_t node_id; > > node_id =3D entry->node_id; > > -- > 2.38.1 >