lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200617191002.GP4151@kadam>
Date:   Wed, 17 Jun 2020 22:10:02 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Zhixu Zhao <zhixu001@....com>
Cc:     Rob Springer <rspringer@...gle.com>,
        Todd Poynor <toddpoynor@...gle.com>,
        Ben Chan <benchan@...omium.org>, Richard Yeh <rcy@...gle.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
        Joe Perches <joe@...ches.com>
Subject: Re: [PATCH v2] staging: gasket: core: Fix a coding style issue in
 gasket_core.c

On Thu, Jun 18, 2020 at 12:11:27AM +0800, Zhixu Zhao wrote:
> diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging/gasket/gasket_core.c
> index 67325fbaf760..28dab302183b 100644
> --- a/drivers/staging/gasket/gasket_core.c
> +++ b/drivers/staging/gasket/gasket_core.c
> @@ -261,6 +261,7 @@ static int gasket_map_pci_bar(struct gasket_dev *gasket_dev, int bar_num)
>  	const struct gasket_driver_desc *driver_desc =
>  		internal_desc->driver_desc;
>  	ulong desc_bytes = driver_desc->bar_descriptions[bar_num].size;
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Get rid of this as well (below).

> +	struct gasket_bar_data *data;
>  	int ret;
>  
>  	if (desc_bytes == 0)
> @@ -270,31 +271,32 @@ static int gasket_map_pci_bar(struct gasket_dev *gasket_dev, int bar_num)
>  		/* not PCI: skip this entry */
>  		return 0;
>  	}
> +
> +	data = &gasket_dev->bar_data[bar_num];

It would be better to do this in the declaration block so you can change
the earlier two uses in this function:

+	struct gasket_bar_data *data = &gasket_dev->bar_data[bar_num];
-	ulong desc_bytes = driver_desc->bar_descriptions[bar_num].size;
+	ulong desc_bytes = data->size;

...

-	if (driver_desc->bar_descriptions[bar_num].type != PCI_BAR) {
+	if (data->type != PCI_BAR) {

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ