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=-8.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, INCLUDES_PATCH,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 43BE5C2BB1D for ; Fri, 13 Mar 2020 17:15:49 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1A7EB20746 for ; Fri, 13 Mar 2020 17:15:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="S3EXNcOR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1A7EB20746 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2E6F76EC3B; Fri, 13 Mar 2020 17:15:48 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 21ED86EC3D for ; Fri, 13 Mar 2020 17:15:47 +0000 (UTC) Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 89F2C206B7; Fri, 13 Mar 2020 17:15:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584119746; bh=DKVElybsjLDvAU1zHyX3rQlN2QwCuWEYTxh2dGG82oY=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=S3EXNcORNhvHYil3IrQUOmh+G4aQjFVNfj+/5coCCPOZEAGFzPS/ZRFQtcmPh9AH6 ynJBLiSZCIa2l3dgeCF4mXngPhlgzBNz19kAm/2djRuSFgJwG5NdTBG31wdtT76qV4 J6zZH4XMtE6cskhNhzI1lTgIKRWz8zn39au6Nj3E= Subject: Re: [v2] dma-buf: heaps: bugfix for selftest failure To: Leon He , sumit.semwal@linaro.org References: <1583589765-19344-1-git-send-email-hexiaolong2008@gmail.com> From: shuah Message-ID: <8613a6fb-1f3f-81e9-54c9-7356ce99cf87@kernel.org> Date: Fri, 13 Mar 2020 11:15:45 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <1583589765-19344-1-git-send-email-hexiaolong2008@gmail.com> Content-Language: en-US X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leon He , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-kselftest@vger.kernel.org, shuah , linux-media@vger.kernel.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 3/7/20 7:02 AM, Leon He wrote: > From: Leon He > > There are two errors in the dmabuf-heap selftest: > 1. The 'char name[5]' was not initialized to zero, which will cause > strcmp(name, "vgem") failed in check_vgem(). > 2. The return value of test_alloc_errors() should be reversed, other- > wise the while loop in main() will be broken. > > Signed-off-by: Leon He > --- > tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c b/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c > index cd5e1f6..836b185 100644 > --- a/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c > +++ b/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c > @@ -22,7 +22,7 @@ > static int check_vgem(int fd) > { > drm_version_t version = { 0 }; > - char name[5]; > + char name[5] = { 0 }; > int ret; > > version.name_len = 4; Please see my comment on v1 for this. > @@ -357,7 +357,7 @@ static int test_alloc_errors(char *heap_name) > if (heap_fd >= 0) > close(heap_fd); > > - return ret; > + return !ret; This change doesn't make sense. Initializing ret to 0 is a better way to go. thanks, -- Shuah _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel