Linux IA64 platform development
 help / color / mirror / Atom feed
* [PATCH] Fix Intel IOMMU Compilation Warnings on IA64
       [not found]       ` <A6AD88C3F2289247BE726C37303E1EB8A4DF7DB1@orsmsx505.amr.corp.intel.com>
@ 2009-05-13 23:13         ` Fenghua Yu
  2009-05-14 15:17           ` David Woodhouse
  0 siblings, 1 reply; 4+ messages in thread
From: Fenghua Yu @ 2009-05-13 23:13 UTC (permalink / raw)
  To: 'David Woodhouse', 'Tony Luck'
  Cc: 'lkml', 'iommu', 'ia64'

Compiling kernel on IA64 reports two warnings in intel-iommu.c:

drivers/pci/intel-iommu.c:3150: warning: format ?%llx? expects type ?long long unsigned int?, but argument 4 has type ?u64?
drivers/pci/intel-iommu.c: In function ?intel_iommu_map_range?:
drivers/pci/intel-iommu.c:3201: warning: format ?%llx? expects type ?long long unsigned int?, but argument 4 has type ?u64?

The warnings are fixed by adding type cast unsigned long long.

Signed-off-by: Fenghua Yu <fegnhua.yu@intel.com>

---

 intel-iommu.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index a563fbe..6f8cc21 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -3147,7 +3147,8 @@ static int intel_iommu_attach_device(struct iommu_domain *domain,
 	if (end < dmar_domain->max_addr) {
 		printk(KERN_ERR "%s: iommu agaw (%d) is not "
 		       "sufficient for the mapped address (%llx)\n",
-		       __func__, iommu->agaw, dmar_domain->max_addr);
+		       __func__, iommu->agaw,
+		       (unsigned long long)dmar_domain->max_addr);
 		return -EFAULT;
 	}
 
@@ -3198,7 +3199,8 @@ static int intel_iommu_map_range(struct iommu_domain *domain,
 		if (end < max_addr) {
 			printk(KERN_ERR "%s: iommu agaw (%d) is not "
 			       "sufficient for the mapped address (%llx)\n",
-			       __func__, min_agaw, max_addr);
+			       __func__, min_agaw,
+			       (unsigned long long)max_addr);
 			return -EFAULT;
 		}
 		dmar_domain->max_addr = max_addr;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix Intel IOMMU Compilation Warnings on IA64
  2009-05-13 23:13         ` [PATCH] Fix Intel IOMMU Compilation Warnings on IA64 Fenghua Yu
@ 2009-05-14 15:17           ` David Woodhouse
  2009-05-14 15:31             ` Matthew Wilcox
  2009-05-14 17:59             ` Fenghua Yu
  0 siblings, 2 replies; 4+ messages in thread
From: David Woodhouse @ 2009-05-14 15:17 UTC (permalink / raw)
  To: Fenghua Yu
  Cc: 'Tony Luck', 'lkml', 'iommu',
	'ia64'

On Wed, 2009-05-13 at 16:13 -0700, Fenghua Yu wrote:
> Compiling kernel on IA64 reports two warnings in intel-iommu.c:
> 
> drivers/pci/intel-iommu.c:3150: warning: format ?%llx? expects
> type ?long long unsigned int?, but argument 4 has type ?u64?
> drivers/pci/intel-iommu.c: In function ?intel_iommu_map_range?:
> drivers/pci/intel-iommu.c:3201: warning: format ?%llx? expects
> type ?long long unsigned int?, but argument 4 has type ?u64?

Charset corruption there? I'm sure GCC didn't actually use question
marks...

> The warnings are fixed by adding type cast unsigned long long.
> 
> Signed-off-by: Fenghua Yu <fegnhua.yu@intel.com>
> 
> ---
> 
>  intel-iommu.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
> index a563fbe..6f8cc21 100644
> --- a/drivers/pci/intel-iommu.c
> +++ b/drivers/pci/intel-iommu.c
> @@ -3147,7 +3147,8 @@ static int intel_iommu_attach_device(struct
> iommu_domain *domain,
>         if (end < dmar_domain->max_addr) {
>                 printk(KERN_ERR "%s: iommu agaw (%d) is not "
>                        "sufficient for the mapped address (%llx)\n",
> -                      __func__, iommu->agaw, dmar_domain->max_addr);
> +                      __func__, iommu->agaw,
> +                      (unsigned long long)dmar_domain->max_addr);
>                 return -EFAULT;
>         }

Perhaps this would be better, modelled after commit fe333321:

diff --git a/arch/ia64/include/asm/types.h b/arch/ia64/include/asm/types.h
index e36b371..b0ecc20 100644
--- a/arch/ia64/include/asm/types.h
+++ b/arch/ia64/include/asm/types.h
@@ -13,7 +13,11 @@
  *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
  */
 
+#ifdef __KERNEL__
+#include <asm-generic/int-ll64.h>
+#else
 #include <asm-generic/int-l64.h>
+#endif
 
 #ifdef __ASSEMBLY__
 # define __IA64_UL(x)		(x)

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix Intel IOMMU Compilation Warnings on IA64
  2009-05-14 15:17           ` David Woodhouse
@ 2009-05-14 15:31             ` Matthew Wilcox
  2009-05-14 17:59             ` Fenghua Yu
  1 sibling, 0 replies; 4+ messages in thread
From: Matthew Wilcox @ 2009-05-14 15:31 UTC (permalink / raw)
  To: David Woodhouse
  Cc: Fenghua Yu, 'Tony Luck', 'lkml', 'iommu',
	'ia64'

On Thu, May 14, 2009 at 04:17:51PM +0100, David Woodhouse wrote:
> Perhaps this would be better, modelled after commit fe333321:
>  
> +#ifdef __KERNEL__
> +#include <asm-generic/int-ll64.h>
> +#else
>  #include <asm-generic/int-l64.h>
> +#endif

It's certainly something I've been lobbying for for a while.  There's
various new warnings that crop up, and I wasn't able to log into the
system Tony offered me to fix it on.  Maybe someone who cares about ia64
these days could take care of fixing up the remaining warnings?

I see http://kerneltrap.org/mailarchive/linux-ia64/2008/10/19/3945454
is out there.  There might be a more recent version ... somewhere ...
Perhaps Tony has a copy of it?

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix Intel IOMMU Compilation Warnings on IA64
  2009-05-14 15:17           ` David Woodhouse
  2009-05-14 15:31             ` Matthew Wilcox
@ 2009-05-14 17:59             ` Fenghua Yu
  1 sibling, 0 replies; 4+ messages in thread
From: Fenghua Yu @ 2009-05-14 17:59 UTC (permalink / raw)
  To: David Woodhouse
  Cc: Yu, Fenghua, Luck, Tony, 'lkml', 'iommu',
	'ia64'

On Thu, May 14, 2009 at 08:17:51AM -0700, David Woodhouse wrote:
> On Wed, 2009-05-13 at 16:13 -0700, Fenghua Yu wrote:
> > Compiling kernel on IA64 reports two warnings in intel-iommu.c:
> > 
> > drivers/pci/intel-iommu.c:3150: warning: format ?%llx? expects
> > type ?long long unsigned int?, but argument 4 has type ?u64?
> > drivers/pci/intel-iommu.c: In function ?intel_iommu_map_range?:
> > drivers/pci/intel-iommu.c:3201: warning: format ?%llx? expects
> > type ?long long unsigned int?, but argument 4 has type ?u64?
> 
> Charset corruption there? I'm sure GCC didn't actually use question
> marks...

Yes, somehow the charset is corrupted during procedure. Below is correct one:

drivers/pci/intel-iommu.c: In function ‘intel_iommu_attach_device’:
drivers/pci/intel-iommu.c:3150: warning: format ‘%llx’ expects type ‘long long unsigned int’, but argument 4 has type ‘u64’
drivers/pci/intel-iommu.c: In function ‘intel_iommu_map_range’:
drivers/pci/intel-iommu.c:3201: warning: format ‘%llx’ expects type ‘long long unsigned int’, but argument 4 has type ‘u64’

> 
> Perhaps this would be better, modelled after commit fe333321:
> 
> diff --git a/arch/ia64/include/asm/types.h b/arch/ia64/include/asm/types.h
> index e36b371..b0ecc20 100644
> --- a/arch/ia64/include/asm/types.h
> +++ b/arch/ia64/include/asm/types.h
> @@ -13,7 +13,11 @@
>   *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
>   */
>  
> +#ifdef __KERNEL__
> +#include <asm-generic/int-ll64.h>
> +#else
>  #include <asm-generic/int-l64.h>
> +#endif
>  
>  #ifdef __ASSEMBLY__
>  # define __IA64_UL(x)		(x)
> 

A lot of places in IA64 kernel assume l64. So it would be a big patch and
testing to change to ll64. I assume Matthew's patch will do that?

Thanks.

-Fenghua

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-05-14 17:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20090327212241.234500000@intel.com>
     [not found] ` <20090327212321.070229000@intel.com>
     [not found]   ` <20090416001957.GA1527@linux-os.sc.intel.com>
     [not found]     ` <1240135508.3589.75.camel@macbook.infradead.org>
     [not found]       ` <A6AD88C3F2289247BE726C37303E1EB8A4DF7DB1@orsmsx505.amr.corp.intel.com>
2009-05-13 23:13         ` [PATCH] Fix Intel IOMMU Compilation Warnings on IA64 Fenghua Yu
2009-05-14 15:17           ` David Woodhouse
2009-05-14 15:31             ` Matthew Wilcox
2009-05-14 17:59             ` Fenghua Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox