lkml.org 
[lkml]   [2020]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@oracle.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
\
 
 \ /
  Last update: 2020-07-15 13:11    [W:0.195 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site