public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Gross <mgross@linux.intel.com>
To: Al Viro <viro@ftp.linux.org.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	anil.s.keshavamurthy@intel.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] intel-iommu fixes
Date: Mon, 29 Oct 2007 09:52:53 -0700	[thread overview]
Message-ID: <20071029165253.GA710@linux.intel.com> (raw)
In-Reply-To: <20071029045116.GB8181@ftp.linux.org.uk>

On Mon, Oct 29, 2007 at 04:51:16AM +0000, Al Viro wrote:
> 	* off by one in dmar_get_fault_reason() (maximal index in
> array is ARRAY_SIZE()-1, not ARRAY_SIZE())
> 	* NULL noise removal
> 	* __iomem annotation fix
> 
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> ---
> diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
> index 0c4ab3b..9b35259 100644
> --- a/drivers/pci/intel-iommu.c
> +++ b/drivers/pci/intel-iommu.c
> @@ -745,7 +745,7 @@ static char *fault_reason_strings[] =
>  	"non-zero reserved fields in PTE",
>  	"Unknown"
>  };
> -#define MAX_FAULT_REASON_IDX 	ARRAY_SIZE(fault_reason_strings)
> +#define MAX_FAULT_REASON_IDX 	ARRAY_SIZE(fault_reason_strings) - 1

Probably should be 
+#define MAX_FAULT_REASON_IDX 	(ARRAY_SIZE(fault_reason_strings) - 1)

>  
>  char *dmar_get_fault_reason(u8 fault_reason)
>  {
> @@ -995,7 +995,6 @@ static struct intel_iommu *alloc_iommu(struct dmar_drhd_unit *drhd)
>  	return iommu;
>  error_unmap:
>  	iounmap(iommu->reg);
> -	iommu->reg = 0;
>  error:
>  	kfree(iommu);
>  	return NULL;
> @@ -1808,7 +1807,7 @@ get_valid_domain_for_dev(struct pci_dev *pdev)
>  	if (!domain) {
>  		printk(KERN_ERR
>  			"Allocating domain for %s failed", pci_name(pdev));
> -		return 0;
> +		return NULL;
>  	}
>  
>  	/* make sure context mapping is ok */
> @@ -1818,7 +1817,7 @@ get_valid_domain_for_dev(struct pci_dev *pdev)
>  			printk(KERN_ERR
>  				"Domain context map for %s failed",
>  				pci_name(pdev));
> -			return 0;
> +			return NULL;
>  		}
>  	}
>  
> diff --git a/drivers/pci/intel-iommu.h b/drivers/pci/intel-iommu.h
> index ee88dd2..459ad1f 100644
> --- a/drivers/pci/intel-iommu.h
> +++ b/drivers/pci/intel-iommu.h
> @@ -58,7 +58,7 @@
>  		hi = readl(dmar + reg + 4); \
>  		(((u64) hi) << 32) + lo; })
>  */
> -static inline u64 dmar_readq(void *addr)
> +static inline u64 dmar_readq(void __iomem *addr)
>  {
>  	u32 lo, hi;
>  	lo = readl(addr);
Looks good to me.

ACK --mgross

  parent reply	other threads:[~2007-10-29 16:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-29  4:51 [PATCH] intel-iommu fixes Al Viro
2007-10-29 15:25 ` Mark Rustad
2007-10-29 16:52 ` Mark Gross [this message]
2007-11-16  7:14 ` Denys Vlasenko

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=20071029165253.GA710@linux.intel.com \
    --to=mgross@linux.intel.com \
    --cc=anil.s.keshavamurthy@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@ftp.linux.org.uk \
    /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