Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp396243pxv; Wed, 14 Jul 2021 06:35:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3sZwrllz/uS5QFf1GqklXHnn3ROoTerKurP1nA+u9Ok3TARC26LfUK+ZogKMUbNpol389 X-Received: by 2002:adf:d088:: with SMTP id y8mr12891439wrh.69.1626269712212; Wed, 14 Jul 2021 06:35:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626269712; cv=none; d=google.com; s=arc-20160816; b=xiQ1C3wVvRaPzdLx1Uu75EH7nLOj89hDGXRRtILKmKtIW1ctgv4Fbk7ZDf4ACcmHfI maMqpZSrhJ97xvVVRy9RIW1jr9FfglcSPdvcrK3P5hgUoDY+nggCw4HJwNcXH5J/4tXT 2Z3Xop6KBzbth0tpWXlZ5mSmvdiFeyo+LtOBaGvTbS4/DrhERT+mA+VjI0fWoUZm+8XY oIwlAA8NGeYfcykroBldYPQei53eJtPQoeWwqtWcJnajv/F+Da1Qj8qcLNKbn4EABdr9 ZZunC6yeGY7uDPmTc32ivUIoB/NSpFnqJlt09B/FnthHem8Mr3b870YglXynjFFtbm70 tbyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=VJxlTJ1XN3jRDHNNvgt5P3v8pnejqQJk8QQzrEvGJlU=; b=ftAb7MgpVwJE85yzkzyn6/1ATmUkwpSgTMCe06erHia87Q9qCtceGjeTz/ErSRmh3X 8Wt9dcxlqhk1RZBDFAB+pbrHFfG8MdAFPZNYwrIMoz9g9RkT9e39HyyTcPxqH6ykpr3w n3XSpFh6e1TR0e1D8+yWZ63VKXjNGRK7BrlRt6iu5oT4OMjLOuGAsEMTidSyz/uFZubF pTsLzjZvCqoCwstPzfa6pLlzLUp4DuRuajMWwkPohjsxl7YpKsqpo2aRDHOZv5g+deDe /clNk7dwzyDvbq79NvEJHGCYl3zIiEY0LV9w84tNcjOaQ6WxjccIQFPbIG95+XYa6bA9 jSdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=sRTfR0bp; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n2si2437045eju.548.2021.07.14.06.34.47; Wed, 14 Jul 2021 06:35:12 -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=@ti.com header.s=ti-com-17Q1 header.b=sRTfR0bp; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231643AbhGNNfs (ORCPT + 99 others); Wed, 14 Jul 2021 09:35:48 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:59872 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231485AbhGNNfs (ORCPT ); Wed, 14 Jul 2021 09:35:48 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 16EDWocJ042933; Wed, 14 Jul 2021 08:32:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1626269570; bh=VJxlTJ1XN3jRDHNNvgt5P3v8pnejqQJk8QQzrEvGJlU=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=sRTfR0bptL5MrsOtq4zjQbB0bCM1yvzYHjOfmcDLJznTHpDJ4VSFiy6TkGfRSOfoi BsbSjQTEmXK3vB1i+fYz9hR9riuoosga55HkNmYt4s2oAUkGJA4PDDACTIYrTFL41A ziP4lRKEry8GH9fOKDVTRizielNsBBddCuu92WP4= Received: from DFLE101.ent.ti.com (dfle101.ent.ti.com [10.64.6.22]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 16EDWoVr043632 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 14 Jul 2021 08:32:50 -0500 Received: from DFLE114.ent.ti.com (10.64.6.35) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Wed, 14 Jul 2021 08:32:49 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2 via Frontend Transport; Wed, 14 Jul 2021 08:32:50 -0500 Received: from [10.250.235.160] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 16EDWkcB018210; Wed, 14 Jul 2021 08:32:47 -0500 Subject: Re: [PATCH v2] tools: PCI: Zero-initialize param To: Shunyong Yang , , , , CC: , References: <20210714132331.5200-1-yang.shunyong@gmail.com> From: Kishon Vijay Abraham I Message-ID: <9e40fd4c-6aec-db3e-f323-0f2cfb67d58c@ti.com> Date: Wed, 14 Jul 2021 19:02:46 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210714132331.5200-1-yang.shunyong@gmail.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/07/21 6:53 pm, Shunyong Yang wrote: > The values in param may be random if they are not initialized, which > may cause use_dma flag set even when "-d" option is not provided > in command line. Initializing all members to 0 to solve this. > > Signed-off-by: Shunyong Yang Thanks for the fix. Acked-by: Kishon Vijay Abraham I > --- > v2: Change {0} to {} as Leon Romanovsky's comment. > --- > tools/pci/pcitest.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/pci/pcitest.c b/tools/pci/pcitest.c > index 0a1344c45213..441b54234635 100644 > --- a/tools/pci/pcitest.c > +++ b/tools/pci/pcitest.c > @@ -40,7 +40,7 @@ struct pci_test { > > static int run_test(struct pci_test *test) > { > - struct pci_endpoint_test_xfer_param param; > + struct pci_endpoint_test_xfer_param param = {}; > int ret = -EINVAL; > int fd; > >