mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zhao <zhixu001@126.com>
To: "Dan Carpenter" <dan.carpenter@oracle.com>
Cc: "Rob Springer" <rspringer@google.com>,
	"Todd Poynor" <toddpoynor@google.com>,
	"Ben Chan" <benchan@chromium.org>, "Richard Yeh" <rcy@google.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	"Joe Perches" <joe@perches.com>
Subject: Re: [PATCH v2] staging: gasket: core: Fix a coding style issue in gasket_core.c
Date: Wed, 15 Jul 2020 18:38:55 +0800 (CST)	[thread overview]
Message-ID: <782deb83.5bf6.173520e4cef.Coremail.zhixu001@126.com> (raw)
In-Reply-To: <20200617191002.GP4151@kadam>

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

  reply	other threads:[~2020-07-15 11:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17 16:11 Zhixu Zhao
2020-06-17 19:10 ` Dan Carpenter
2020-07-15 10:38   ` Zhao [this message]
2020-06-18 13:44 ` Zhixu Zhao
2020-06-18 14:03   ` Dan Carpenter
2020-07-14 23:44 ` Zhixu Zhao
2020-07-15  7:17   ` Greg KH
2020-07-15  7:24     ` Joe Perches
2020-07-15  7:57       ` Greg KH
2020-07-15  8:37         ` Dan Carpenter
2020-07-15  9:04           ` Joe Perches
2020-07-15 10:45             ` Zhao
2020-07-15 11:06               ` Dan Carpenter
2020-07-15 13:33 ` [PATCH v3] " Zhixu Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=782deb83.5bf6.173520e4cef.Coremail.zhixu001@126.com \
    --to=zhixu001@126.com \
    --cc=benchan@chromium.org \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rcy@google.com \
    --cc=rspringer@google.com \
    --cc=toddpoynor@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®