From: Dan Carpenter <dan.carpenter@oracle.com>
To: Zhixu Zhao <zhixu001@126.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, 17 Jun 2020 22:10:02 +0300 [thread overview]
Message-ID: <20200617191002.GP4151@kadam> (raw)
In-Reply-To: <20200617161127.32006-1-zhixu001@126.com>
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
next prev parent reply other threads:[~2020-06-17 19:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-17 16:11 [PATCH v2] staging: gasket: core: Fix a coding style issue in gasket_core.c Zhixu Zhao
2020-06-17 19:10 ` Dan Carpenter [this message]
2020-07-15 10:38 ` Zhao
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=20200617191002.GP4151@kadam \
--to=dan.carpenter@oracle.com \
--cc=benchan@chromium.org \
--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 \
--cc=zhixu001@126.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.