Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1955132ybh; Fri, 13 Mar 2020 10:18:15 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvyBvV3m7sH0ixiKYmwuK9tsSaVnmH0RbT3GGVW6fA3pl/nEdCSfDO93uYIr+qC0Vzf7OKg X-Received: by 2002:a9d:6c0b:: with SMTP id f11mr11579602otq.182.1584119895262; Fri, 13 Mar 2020 10:18:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584119895; cv=none; d=google.com; s=arc-20160816; b=h342mM/TQhiySwImb2I2EWIQf/7Om00xAJowwuoxfqiaSkejIB9HO/NNrsh5UvJSBD CsIg/U4U8I+DRsztmi5YyrU4rbecAR1mK6RC/tn7KkS+EFb/r6X2JBvbQyKjQlzAXT+Q IkQzPJjLy79YuxSqQbHVKnA4DIYykYLr7BW2HgaaJTF26HOryG0VqH7ejFv5FIaL+E0S q4PrfTS2JzM/BwKzR0O1Fc5HZWMm1BidKsxM925d2aeyrBuGzoLYIETHtC5TQJBJd+sP rhk5CQFpW8s3mYu+qsyJDTWtDY7Itv5vSHSOSI+zDowqtlBuRB9XLWh0Dm0knSGJzV2/ 80lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=dk7cc2yDY//3SY4AoyTR+MGKvmxdh40tDRxId2g8LW4=; b=u7WnNzAPuZ6DwL5Jw/omJA//k9TOBSgAjevLWyPKcBM873WO8KoL+H+Vv7wlWBhiPJ NGXaSvqyBcGOpu2SiB14d/Vi3AKt9IHkoz8KjRPFnzTnQW03xVNAcC9iLFRzG3vQO2TG cttbc+sFy+7pENWnLijYN59Bg22jyJyFSF/mqATQJBQVMT5J1KAwblfb8fkfOtkB4Sod Uud5RCfTOlWy8gGjd6RpqPTMQP1PpcTHX0HtWVhvpim9YuwDlrGcKALo8w7Nj6uPIdlH 1NPPDAmRbGwPYi4eRVXSL1DavexmrlioXKFrRzNSJYTyt74zRO1ZghJNuYvLil8bqhVJ S+pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=S3EXNcOR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z13si4890515oic.70.2020.03.13.10.17.54; Fri, 13 Mar 2020 10:18: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=@kernel.org header.s=default header.b=S3EXNcOR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727000AbgCMRPs (ORCPT + 99 others); Fri, 13 Mar 2020 13:15:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:54160 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726706AbgCMRPr (ORCPT ); Fri, 13 Mar 2020 13:15:47 -0400 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 Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, Leon He , shuah 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-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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