[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <782deb83.5bf6.173520e4cef.Coremail.zhixu001@126.com>
Date: Wed, 15 Jul 2020 18:38:55 +0800 (CST)
From: Zhao <zhixu001@....com>
To: "Dan Carpenter" <dan.carpenter@...cle.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
At 2020-06-18 03:10:02, "Dan Carpenter" <dan.carpenter@...cle.com> wrote:
>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
This issue has been resolved in https://lore.kernel.org/lkml/20200618140327.GS4151@kadam/
Zhixu
Powered by blists - more mailing lists