All of lore.kernel.org
 help / color / mirror / Atom feed
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 4/4] VT-d/qinval: queue index is always unsigned
Date: Mon, 16 Jun 2014 14:56:50 +0100	[thread overview]
Message-ID: <539EF7A2.2040205@citrix.com> (raw)
In-Reply-To: <539F03F1020000780001AA40@mail.emea.novell.com>


[-- Attachment #1.1: Type: text/plain, Size: 3816 bytes --]

On 16/06/14 13:49, Jan Beulich wrote:
> At once drop bogus initializers.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

>
> --- a/xen/drivers/passthrough/vtd/qinval.c
> +++ b/xen/drivers/passthrough/vtd/qinval.c
> @@ -43,7 +43,7 @@ static void print_qi_regs(struct iommu *
>      printk("DMAR_IQT_REG = %"PRIx64"\n", val);
>  }
>  
> -static int qinval_next_index(struct iommu *iommu)
> +static unsigned int qinval_next_index(struct iommu *iommu)
>  {
>      u64 tail;
>  
> @@ -58,7 +58,7 @@ static int qinval_next_index(struct iomm
>      return tail;
>  }
>  
> -static void qinval_update_qtail(struct iommu *iommu, int index)
> +static void qinval_update_qtail(struct iommu *iommu, unsigned int index)
>  {
>      u64 val;
>  
> @@ -68,7 +68,7 @@ static void qinval_update_qtail(struct i
>      dmar_writeq(iommu->reg, DMAR_IQT_REG, (val << QINVAL_INDEX_SHIFT));
>  }
>  
> -static int gen_cc_inv_dsc(struct iommu *iommu, int index,
> +static int gen_cc_inv_dsc(struct iommu *iommu, unsigned int index,
>      u16 did, u16 source_id, u8 function_mask, u8 granu)
>  {
>      unsigned long flags;
> @@ -101,7 +101,7 @@ int queue_invalidate_context(struct iomm
>  {
>      int ret;
>      unsigned long flags;
> -    int index = -1;
> +    unsigned int index;
>  
>      spin_lock_irqsave(&iommu->register_lock, flags);
>      index = qinval_next_index(iommu);
> @@ -112,7 +112,7 @@ int queue_invalidate_context(struct iomm
>      return ret;
>  }
>  
> -static int gen_iotlb_inv_dsc(struct iommu *iommu, int index,
> +static int gen_iotlb_inv_dsc(struct iommu *iommu, unsigned int index,
>      u8 granu, u8 dr, u8 dw, u16 did, u8 am, u8 ih, u64 addr)
>  {
>      unsigned long flags;
> @@ -149,7 +149,7 @@ int queue_invalidate_iotlb(struct iommu 
>  {
>      int ret;
>      unsigned long flags;
> -    int index = -1;
> +    unsigned int index;
>  
>      spin_lock_irqsave(&iommu->register_lock, flags);
>  
> @@ -161,7 +161,7 @@ int queue_invalidate_iotlb(struct iommu 
>      return ret;
>  }
>  
> -static int gen_wait_dsc(struct iommu *iommu, int index,
> +static int gen_wait_dsc(struct iommu *iommu, unsigned int index,
>      u8 iflag, u8 sw, u8 fn, u32 sdata, volatile u32 *saddr)
>  {
>      unsigned long flags;
> @@ -192,7 +192,7 @@ static int queue_invalidate_wait(struct 
>  {
>      s_time_t start_time;
>      volatile u32 poll_slot = QINVAL_STAT_INIT;
> -    int index = -1;
> +    unsigned int index;
>      int ret;
>      unsigned long flags;
>  
> @@ -231,7 +231,7 @@ static int invalidate_sync(struct iommu 
>      return 0;
>  }
>  
> -static int gen_dev_iotlb_inv_dsc(struct iommu *iommu, int index,
> +static int gen_dev_iotlb_inv_dsc(struct iommu *iommu, unsigned int index,
>      u32 max_invs_pend, u16 sid, u16 size, u64 addr)
>  {
>      unsigned long flags;
> @@ -266,7 +266,7 @@ int qinval_device_iotlb(struct iommu *io
>  {
>      int ret;
>      unsigned long flags;
> -    int index = -1;
> +    unsigned int index;
>  
>      spin_lock_irqsave(&iommu->register_lock, flags);
>      index = qinval_next_index(iommu);
> @@ -277,7 +277,7 @@ int qinval_device_iotlb(struct iommu *io
>      return ret;
>  }
>  
> -static int gen_iec_inv_dsc(struct iommu *iommu, int index,
> +static int gen_iec_inv_dsc(struct iommu *iommu, unsigned int index,
>      u8 granu, u8 im, u16 iidx)
>  {
>      unsigned long flags;
> @@ -308,7 +308,7 @@ int queue_invalidate_iec(struct iommu *i
>  {
>      int ret;
>      unsigned long flags;
> -    int index = -1;
> +    unsigned int index;
>  
>      spin_lock_irqsave(&iommu->register_lock, flags);
>      index = qinval_next_index(iommu);
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


[-- Attachment #1.2: Type: text/html, Size: 4549 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2014-06-16 13:56 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
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 [this message]
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=539EF7A2.2040205@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.