Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2167416pxv; Sun, 11 Jul 2021 04:57:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOQGZLSADqsHN0beB1sDma9JuNjgFBTx/rTVl6nsKS+ct6hBNKajMH+38kAnoN6mR2jL5j X-Received: by 2002:a17:906:388b:: with SMTP id q11mr48249384ejd.43.1626004671634; Sun, 11 Jul 2021 04:57:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626004671; cv=none; d=google.com; s=arc-20160816; b=C0e03lroemVoJBmfdgIFakDImLWMcOuF1hvtYVtx1dzhKanG1d+gCtzfWfsG/4Bx/B BDwKt0QmuEIFEapwY25m3DzPXDGbyeRkm5xlSxQdAPjm+sW/XookPXXdlCo/zIgQq8sb 2FCGN0EbZlmIOCFvXlNag2Il7wnRpODKGTTMK9QYbmnl0064srFSYTr5vW/ZOY9Fupkp aFPHc1QW0391HQ2+dPUf+thJIdQIDTwYq1XNoYXMJvT/jv4UTsWfqBiYWPRxoyQ+ydm0 4G4fs/YQYc5dwYtbTZfVsaU7QZiocmUS3WGoDtvvMpHxZg9GbRYobKycktE3rhK6szaQ x76g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=x8PgaRAgt0+UqV4+9V+h5kma0ipWB9mA0oiqCOxj0Y0=; b=eO4d3L6zcXc/g6WH3Z92Sj2aYVXK7dn/RVUNrzmHkXHmgpnwIx/NRHiP3v1fRF3h3F 7H0+8wVqGL/rx+JIAux1Jpv80r/NLg6oVdFQ9Mk0eiuXHMZW7Vp+rhBvC2GJ4Cl3A+Sz VxrtO1OSKOibsgemKbjnC2DKnhvKfE0+4+jsqTAx8gZi/riKA/tdnERuAoGrZNYUuc3H PSE4GfsW2XaGf/L8B6DXT33nJkJiWf+F69tleEd+nUCkJWFrmsWuhFl1yXfbp+RHVxQ8 tGFW2AIM2fmOe+hxxm/2h9JAiJFbyn8/IvJRYLaty3tqLOSpSkhinSnQffCg0IcptS7u Kz8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rfjwd3Sr; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o8si15605681ejj.94.2021.07.11.04.57.29; Sun, 11 Jul 2021 04:57:51 -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=@kernel.org header.s=k20201202 header.b=rfjwd3Sr; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232768AbhGKL6x (ORCPT + 99 others); Sun, 11 Jul 2021 07:58:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:48464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229688AbhGKL6x (ORCPT ); Sun, 11 Jul 2021 07:58:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C8D5F61090; Sun, 11 Jul 2021 11:56:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626004566; bh=WzhpHgoJ55znqI9v2KgCulY11RVSrhkw90oNP0TAaNo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rfjwd3SrnEITNEfGHks9pZLMimE7BuMh6egQEIoqoSaepy6W8Ye1fCzaKtYPXOjSQ JQMF9CHURnTFGs9BydGrLmr19o/orWyGyk3//Lx9su6Z1nrCjAH6MCxVYBAnFIazRT xS/hVXOi4psGZHwjHUUZYV1t9aCUNjTPsa1V8wvY5MYSIU6mm6oaQ2P+oxkehFVNBY WhAq/YqIYrUM5LoOLZrAgD0WwwkNOkTK4K7yJ6W5HtYOkAQNZ1vkCfdF494qKFlDvo K9CJBDj6IYhCzj/tW2fA2bXGf2Qr8g/y4FD4bisQcsJ2WcsfGw4WZIEEW8Hdl1Dku/ nfYtc6Kz3GF6A== Date: Sun, 11 Jul 2021 14:56:01 +0300 From: Leon Romanovsky To: Shunyong Yang Cc: bhelgaas@google.com, kishon@ti.com, lorenzo.pieralisi@arm.com, kw@linux.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] tools: PCI: Zero-initialize param Message-ID: References: <20210627003937.6249-1-yang.shunyong@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 11, 2021 at 09:48:17AM +0800, Shunyong Yang wrote: > Hi, Bjorn and Kishon, > > ? Gentle ping. Would you please help to review and merge this tiny change? > > Thansk. > > Shunyong. > > On 2021/6/27 8:39, 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 > > --- > > 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..59bcd6220a58 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 = {0}; You can simply write {} instead of {0} - zero is not needed. Thanks > > int ret = -EINVAL; > > int fd;