From: "Roger Pau Monné" <roger.pau@citrix.com>
To: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
Juergen Gross <jgross@suse.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Dwayne Litzenberger <dlitz@dlitz.net>,
<xen-devel@lists.xenproject.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH 1/2] xen-pciback: Fix error return in bar_write() and rom_write()
Date: Mon, 3 Dec 2018 13:35:19 +0100 [thread overview]
Message-ID: <20181203123519.l34a4yx26qle3whb@mac> (raw)
In-Reply-To: <f5ea0f3c2e29a96b59e409e4ae4c62de11a05fc8.1543772656.git-series.marmarek@invisiblethingslab.com>
On Sun, Dec 02, 2018 at 06:47:32PM +0100, Marek Marczykowski-Górecki wrote:
> From: Dwayne Litzenberger <dlitz@dlitz.net>
I think this requires some description. At least a note that the
function is not altered, just errors from pci reads/writes are no
longer ignored.
> Signed-off-by: Dwayne Litzenberger <dlitz@dlitz.net>
> ---
> drivers/xen/xen-pciback/conf_space_header.c | 24 ++++++++++++++++------
> 1 file changed, 18 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/xen/xen-pciback/conf_space_header.c b/drivers/xen/xen-pciback/conf_space_header.c
> index 10ae24b..697d0a8 100644
> --- a/drivers/xen/xen-pciback/conf_space_header.c
> +++ b/drivers/xen/xen-pciback/conf_space_header.c
> @@ -135,6 +135,7 @@ static int command_write(struct pci_dev *dev, int offset, u16 value, void *data)
>
> static int rom_write(struct pci_dev *dev, int offset, u32 value, void *data)
> {
> + int err = 0;
> struct pci_bar_info *bar = data;
>
> if (unlikely(!bar)) {
> @@ -150,17 +151,22 @@ static int rom_write(struct pci_dev *dev, int offset, u32 value, void *data)
> bar->which = 1;
> else {
> u32 tmpval;
> - pci_read_config_dword(dev, offset, &tmpval);
> + err = pci_read_config_dword(dev, offset, &tmpval);
> + if (err)
> + goto out;
I don't think you need the out label, you could just return err.
Adding the label doesn't help in any way IMO, just makes the function
one line longer for no reason.
Same for the out label added to bar_write.
Thanks, Roger.
next prev parent reply other threads:[~2018-12-03 12:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-02 17:47 [PATCH 0/2] xen-paciback: Fixes for PCI passthrough of AMD GPU Marek Marczykowski-Górecki
2018-12-02 17:47 ` [PATCH 1/2] xen-pciback: Fix error return in bar_write() and rom_write() Marek Marczykowski-Górecki
2018-12-03 10:55 ` [Xen-devel] " Jan Beulich
2018-12-03 12:35 ` Roger Pau Monné [this message]
2018-12-02 17:47 ` [PATCH 2/2] xen-pciback: Allow enabling/disabling expansion ROM Marek Marczykowski-Górecki
2018-12-03 11:01 ` [Xen-devel] " Jan Beulich
2018-12-03 14:47 ` Marek Marczykowski
2018-12-03 15:04 ` Jan Beulich
2018-12-03 12:53 ` Roger Pau Monné
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=20181203123519.l34a4yx26qle3whb@mac \
--to=roger.pau@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=dlitz@dlitz.net \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marmarek@invisiblethingslab.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/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