Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp37684413rwd; Tue, 11 Jul 2023 18:44:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlH/XhFz0kzz9p1Bjb4cu3CpXSvFCDWQrkYNGswD63ptxxJ9tZ8uFqWfksyK7fl/guq3UrOl X-Received: by 2002:a9d:5e05:0:b0:6b7:2079:b5df with SMTP id d5-20020a9d5e05000000b006b72079b5dfmr15128784oti.2.1689126277156; Tue, 11 Jul 2023 18:44:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689126277; cv=none; d=google.com; s=arc-20160816; b=VdOTjotDXYDDvbatoRMXAJiStqGhjHXg9ZiWcETK+4FSvELCMkyhBsr7G8sYZOxKsM zPZxvG86uvGuxITHZz/VP6u3No3QWlQ/+ap41tiW+YXGC4S0RJ37yJC1t7flOGdmlatG g2llh4/yQ0Kmh9gI8Mch573uRB7RYqU/pPwnBay9zEA844qfiaf4rSr/iZxegPOfEr/w aVfkunvdSkojckTLPdcxoQ/fwxTcwwXlXr8mbUjYOYrFUNFp9BrFhU/SqYzQzAdyRUBv ycGWu8k7rj3xvLrKvD64163v11wlZrJaMQ98agx7lM7d+q2aYG2gr3alaNZ8hYIKIRms w6hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from:cc:to :content-language:subject:user-agent:mime-version:date:message-id; bh=cLgp25tHjT21lMEa4+iipARWdBNB6spXq6G5GpJ8/Hk=; fh=gnS2ZzH1sRrDBy6rL/5hyT3RrttuNC/4jkr7tVALAPY=; b=O3PIQmtA64Q6Jxp+YMsLRxprR2e+U1NVOoJPkYRIZAi93U17aRuJIbMuhNUSSZ6Qug mJvaP40Yuuv5rsQq4AE9F6Y179sRsSBaxOo+TEJeHopcZrYp9LKGm8Us5KHzfyFoBluL KHt7yMe4XAXWQmkxhBLZE6cnK4QNI9veXOX9ZnrBZNcTfU0vuxU4PLRETu7APn2HZbAe 2FNQ2t+lubTxa4Fue0ig1nBE//PFu9Mp/uChGhpJM/6BiRK4P2hxZnSaI+KB8C/e9RaY i0QEuT0TLoIrsInn0ST2+LdQ3oCgh0xy9tBJRONx6HHh3pGEK1e+h6Rw6KOC8pTtNv/f WUHw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n16-20020a17090aab9000b002632bfd62b9si2401156pjq.185.2023.07.11.18.44.25; Tue, 11 Jul 2023 18:44:37 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230263AbjGLBSu (ORCPT + 99 others); Tue, 11 Jul 2023 21:18:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229945AbjGLBSt (ORCPT ); Tue, 11 Jul 2023 21:18:49 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 542B195; Tue, 11 Jul 2023 18:18:46 -0700 (PDT) Received: from [172.30.11.106] (unknown [180.167.10.98]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPSA id 734DC605D3D97; Wed, 12 Jul 2023 09:18:43 +0800 (CST) Message-ID: <0561b89b-42a8-35bf-feaa-e5feb4ec3cd5@nfschina.com> Date: Wed, 12 Jul 2023 09:18:42 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH] drm/virtio: remove some redundant code Content-Language: en-US To: Dan Carpenter Cc: airlied@redhat.com, kraxel@redhat.com, gurchetansingh@chromium.org, olvaffe@gmail.com, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org X-MD-Sfrom: suhui@nfschina.com X-MD-SrcIP: 180.167.10.98 From: Su Hui In-Reply-To: <7f67ed65-647a-44d7-a262-d3f1f48d90b9@kadam.mountain> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 On 2023/7/11 19:13, Dan Carpenter wrote: > On Tue, Jul 11, 2023 at 05:00:31PM +0800, Su Hui wrote: >> virtio_gpu_get_vbuf always be successful, >> so remove the error judgment. >> > No, just ignore the static checker false positive in this case. The > intent of the code is clear that if it did have an error it should > return an error pointer. Hi, Dan, Function "virtio_gpu_get_vbuf" call "kmem_cache_zalloc (vgdev->vbufs, GFP_KERNEL | __GFP_NOFAIL)" to allocate memory. Adding the " __GFP_NOFAIL”flag make sure it won't fail. And "virtio_gpu_get_vbuf" never return an error code, so I think this is not a false positive. Su Hui > > regards, > dan carpenter >