Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp296401pxa; Wed, 26 Aug 2020 10:49:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBtn3Pwrp5u0hfb4gLvyVkrBceh2ewnax+SdYKudgLyK+9+YmTHL6ctRr1qBpUAvDv21F4 X-Received: by 2002:a50:e004:: with SMTP id e4mr15838354edl.114.1598464193075; Wed, 26 Aug 2020 10:49:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598464193; cv=none; d=google.com; s=arc-20160816; b=o36mWmndsKEPSyt6Qfl6jhKrxinjbH8dVS/Qg0s9gJxZeciJjiYt4+CZ7PN4Uc3a3K RoxtEF0jNaExbsaupjvjOq1rJda4wJPWGAM4/TwOTJkTuWvtFKx4iOocMtDURqM9etvf jzNKhG1cL0ekiT2QqQVecspOKAq91bgSE/4DnfBm7mLu9rFEwsvgqEQi2a8UUGgh8WvL 1Buhua92AK6FSuZw5JuYZuFMZ3doQ+qEN0qXrFOMQG5IXEPZeO0tacK2kE4U92mfnVtE pPojqNZHSGrQnsEAqCT+eQ3uKABQtFu6dBR+7+52wGhG0UHTTSNseNcXBnXfpex3K1iz qtyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=DZhvz/VcmtyOV5FpCQGhe3jSJp/wS6UPaYcPASL+W/w=; b=aDf5Ub15ariAAkdTZRrBfJ2bGXzEdPq2Vw9RsLRR2zrrQaw5OsSPKgsdAxfYIycFK5 xL81+VdbcRHA1p0DMLiZ3VsoTNU6oZlZLAdVWIuSPnVuVyw0V+wCjo8T3pMqMArzOtxH PgplkF0PJ14+rG34WAIVUmkxFJJEg+zy6kYEyQ+VZbjIrLwe3b2DRsa6ucLS+1aXf9AM Cr5A4gQrOxjzvEWZV44qon52e2TYcZcfdXu4zrx3mcuRgpPhwrs35Ut5FtjhBhNFc33i SFeh+2nSbiYR1s/m7ASxKrm9EzBb2cIoh6k5NLjwkf4ZCG/A9cOJqY0MQOYz46m6UWEd ULKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@vanguardiasur-com-ar.20150623.gappssmtp.com header.s=20150623 header.b=HEdiitSK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m1si2002326ejj.381.2020.08.26.10.49.30; Wed, 26 Aug 2020 10:49:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@vanguardiasur-com-ar.20150623.gappssmtp.com header.s=20150623 header.b=HEdiitSK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727000AbgHZRsD (ORCPT + 99 others); Wed, 26 Aug 2020 13:48:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726947AbgHZRrt (ORCPT ); Wed, 26 Aug 2020 13:47:49 -0400 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86E89C061757 for ; Wed, 26 Aug 2020 10:47:48 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id oz20so4063089ejb.5 for ; Wed, 26 Aug 2020 10:47:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vanguardiasur-com-ar.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DZhvz/VcmtyOV5FpCQGhe3jSJp/wS6UPaYcPASL+W/w=; b=HEdiitSKEBxMSHU8oTLa3sOT98ZqvBgSHQoEa8wKCD7Bep9IfA3SmowbtjCNMgkw9i jku1yi1AxvYbxckP53qA3tB5mi0Xeepx/+gdavzei1K18KH4XJJ7ql/2GL6DWC7FoP0J DFVlciGxbX1urrNma8ZDr07/YRWt/Uy8XWkxyo6yHLhilLIZNM9TZ2slZHDFGktyk3/Q 9E9A0VZvOP44jHPNyTpdKN92CKWEsGHxifxkxymJ/Nlu23ojN81Emuo0TqlFKCCQ0/bZ QVpX4GgvoQA463xPcCxrkOn6bIi3vIyOL5CtkIXlfdLEfYTsyzwlhbzOju+HDjTrlITC zxLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DZhvz/VcmtyOV5FpCQGhe3jSJp/wS6UPaYcPASL+W/w=; b=faxF9RSDNNTi1EpUG/f4dPskO7jlwBpnye8SnChynkfz8nCyuY3W/UI+bDZ/W7v85Q 9OyBJX1WclbMJKEJYoOBxVawgt2uj8PE9Ezy+vo61DrQQgVpCPXMiji8cLhFTeThvooJ 43Q0RBeB3nT/benR7zuOkdLRWnoML26K7ZqJWwwcmNBTsfwvRiIMdccP+sGjPbc/5ZNm WftRypG/4Bqa1ynmXP/unUmsfUVORkBtDLAC0nbjNQqHMSKnpX4YFvjY6s8LUZ0dUyIY Enpx4FZVBDRjC4AyF4rwiSkaM+ZtbJ4iyYW0WW67r6hWcZCHk/gj5FC7XB2Rt7B12vxh 78Rw== X-Gm-Message-State: AOAM53136UeP/mharPOMZnq1yG1uOytXRSZE2INWN0OdqKtXHauV6q2r pklZHzXFKMg4XUyPFO1Tc1DMfdU0EAWeUYOqbNGmfg== X-Received: by 2002:a17:906:c10c:: with SMTP id do12mr13194774ejc.92.1598464066662; Wed, 26 Aug 2020 10:47:46 -0700 (PDT) MIME-Version: 1.0 References: <1583589765-19344-1-git-send-email-hexiaolong2008@gmail.com> In-Reply-To: <1583589765-19344-1-git-send-email-hexiaolong2008@gmail.com> From: Ezequiel Garcia Date: Wed, 26 Aug 2020 14:47:35 -0300 Message-ID: Subject: Re: [v2] dma-buf: heaps: bugfix for selftest failure To: Leon He Cc: Shuah Khan , Sumit Semwal , linux-kselftest@vger.kernel.org, Linux Kernel Mailing List , linux-media , dri-devel , linaro-mm-sig@lists.linaro.org, Leon He Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Leon, Shuah, Thanks for the fix. I had this issue pending to fix, but have been lazy about it, I appreciate you are taking care of it! On Sat, 7 Mar 2020 at 11:03, 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; > As Shuah already mentioned, I think we want to use strncmp to be on the safe side. > version.name_len = 4; > @@ -357,7 +357,7 @@ static int test_alloc_errors(char *heap_name) > if (heap_fd >= 0) > close(heap_fd); > > - return ret; > + return !ret; I agree with Shuah, this change makes no sense, just drop it. I think the fact this test was broken and nobody noticed uncovers the fact that the test isn't being run. Any reason why this test isn't a regular TARGET? Or any idea how we can make sure this is run by CIs and any other testing system? Thanks! Ezequiel > } > > int main(void) > -- > 2.7.4 >