From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Yang Z Zhang <yang.z.zhang@intel.com>,
xen-devel <xen-devel@lists.xenproject.org>,
xiantao.zhang@intel.com
Subject: Re: [PATCH 3/4] VT-d/qinval: clean up error handling
Date: Mon, 16 Jun 2014 14:55:50 +0100 [thread overview]
Message-ID: <539EF766.8070803@citrix.com> (raw)
In-Reply-To: <539F03D0020000780001AA3C@mail.emea.novell.com>
On 16/06/14 13:48, Jan Beulich wrote:
> - neither qinval_update_qtail() nor qinval_next_index() can fail: make
> the former return "void", and drop caller error checks for the latter
> (all of which would otherwise return with a spin lock still held)
> - or-ing together error codes is a bad idea
>
> At once drop bogus initializers.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/drivers/passthrough/vtd/qinval.c
> +++ b/xen/drivers/passthrough/vtd/qinval.c
> @@ -58,7 +58,7 @@ static int qinval_next_index(struct iomm
> return tail;
> }
>
> -static int qinval_update_qtail(struct iommu *iommu, int index)
> +static void qinval_update_qtail(struct iommu *iommu, int index)
> {
> u64 val;
>
> @@ -66,7 +66,6 @@ static int qinval_update_qtail(struct io
> ASSERT( spin_is_locked(&iommu->register_lock) );
> val = (index + 1) % QINVAL_ENTRY_NR;
> dmar_writeq(iommu->reg, DMAR_IQT_REG, (val << QINVAL_INDEX_SHIFT));
> - return 0;
> }
>
> static int gen_cc_inv_dsc(struct iommu *iommu, int index,
> @@ -100,17 +99,15 @@ static int gen_cc_inv_dsc(struct iommu *
> int queue_invalidate_context(struct iommu *iommu,
> u16 did, u16 source_id, u8 function_mask, u8 granu)
> {
> - int ret = -1;
> + int ret;
> unsigned long flags;
> int index = -1;
This index initialiser is also bogus. It is assigned straight from
qinval_next_index().
But peeking ahead to your next patch, you have addressed it there.
I would suggest that the dropping of -EBUSY clauses would more logically
live with the following patch, but the end result of patches 3 + 4
appear fine.
Either way, Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
next prev parent reply other threads:[~2014-06-16 13:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-16 12:42 [PATCH 0/4] VT-d/qinval: miscellaneous adjustments Jan Beulich
2014-06-16 12:47 ` [PATCH 1/4] VT-d/qinval: make local variable used for communication with IOMMU "volatile" Jan Beulich
2014-06-16 12:55 ` Andrew Cooper
2014-06-16 13:03 ` Jan Beulich
2014-06-20 2:09 ` Zhang, Yang Z
2014-06-16 12:48 ` [PATCH 2/4] VT-d: drop redundant calls to invalidate_sync() Jan Beulich
2014-06-16 13:08 ` Andrew Cooper
2014-06-20 2:10 ` Zhang, Yang Z
2014-06-16 12:48 ` [PATCH 3/4] VT-d/qinval: clean up error handling Jan Beulich
2014-06-16 13:55 ` Andrew Cooper [this message]
2014-06-20 2:12 ` Zhang, Yang Z
2014-06-20 7:27 ` Jan Beulich
2014-06-20 11:30 ` Zhang, Yang Z
2014-06-16 12:49 ` [PATCH 4/4] VT-d/qinval: queue index is always unsigned Jan Beulich
2014-06-16 13:56 ` Andrew Cooper
2014-06-20 2:11 ` Zhang, Yang Z
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=539EF766.8070803@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=xen-devel@lists.xenproject.org \
--cc=xiantao.zhang@intel.com \
--cc=yang.z.zhang@intel.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.