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=-16.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 96B14C07E96 for ; Sun, 11 Jul 2021 11:56:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8013B610D2 for ; Sun, 11 Jul 2021 11:56:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232783AbhGKL6y (ORCPT ); Sun, 11 Jul 2021 07:58:54 -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;