mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: jbarnes@virtuousgeek.org, tglx@linutronix.de, hpa@zytor.com,
	torvalds@linux-foundation.org, akpm@linux-foundation.org,
	arjan@linux.intel.com, linux-kernel@vger.kernel.org,
	Yinghai Lu <yhlu.kernel@gmail.com>
Subject: Re: [patch] ioremap sanity check to catch mapping requests exceeding the BAR sizes
Date: Fri, 26 Sep 2008 10:12:26 +0200	[thread overview]
Message-ID: <20080926081226.GA8556@elte.hu> (raw)
In-Reply-To: <20080926073902.GA30041@elte.hu>


* Ingo Molnar <mingo@elte.hu> wrote:

> > +		printk(KERN_WARNING "resource map sanity check conflict "
> > +		       " 0x%llx 0x%llx 0x%llx 0x%llx %s\n",
> > +		       addr, addr + size - 1, p->start, p->end, p->name);

needed two build fixes (and the printk type checking annoyances keep 
littering the tree):

>From 13eb83754b40bf01dc84e52a08d4196d1b719a0e Mon Sep 17 00:00:00 2001
From: Ingo Molnar <mingo@elte.hu>
Date: Fri, 26 Sep 2008 10:10:12 +0200
Subject: [PATCH] IO resources, x86: ioremap sanity check to catch mapping requests exceeding, fix

fix this build error:

 kernel/resource.c: In function 'iomem_map_sanity_check':
 kernel/resource.c:842: error: implicit declaration of function 'r_next'
 kernel/resource.c:842: warning: assignment makes pointer from integer without a cast

r_next() was only available if CONFIG_PROCFS was enabled.

and fix this build warning:

 kernel/resource.c:855: warning: format '%llx' expects type 'long long unsigned int', but argument 2 has type 'resource_size_t'
 kernel/resource.c:855: warning: format '%llx' expects type 'long long unsigned int', but argument 3 has type 'long unsigned int'
 kernel/resource.c:855: warning: format '%llx' expects type 'long long unsigned int', but argument 4 has type 'resource_size_t'
 kernel/resource.c:855: warning: format '%llx' expects type 'long long unsigned int', but argument 5 has type 'resource_size_t'

resource_t can be 32 bits.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 kernel/resource.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/kernel/resource.c b/kernel/resource.c
index 1d003a5..7797dae 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -38,10 +38,6 @@ EXPORT_SYMBOL(iomem_resource);
 
 static DEFINE_RWLOCK(resource_lock);
 
-#ifdef CONFIG_PROC_FS
-
-enum { MAX_IORES_LEVEL = 5 };
-
 static void *r_next(struct seq_file *m, void *v, loff_t *pos)
 {
 	struct resource *p = v;
@@ -53,6 +49,10 @@ static void *r_next(struct seq_file *m, void *v, loff_t *pos)
 	return p->sibling;
 }
 
+#ifdef CONFIG_PROC_FS
+
+enum { MAX_IORES_LEVEL = 5 };
+
 static void *r_start(struct seq_file *m, loff_t *pos)
 	__acquires(resource_lock)
 {
@@ -852,7 +852,11 @@ int iomem_map_sanity_check(resource_size_t addr, unsigned long size)
 			continue;
 		printk(KERN_WARNING "resource map sanity check conflict: "
 		       "0x%llx 0x%llx 0x%llx 0x%llx %s\n",
-		       addr, addr + size - 1, p->start, p->end, p->name);
+		       (unsigned long long)addr,
+		       (unsigned long long)(addr + size - 1),
+		       (unsigned long long)p->start,
+		       (unsigned long long)p->end,
+		       p->name);
 		err = -1;
 		break;
 	}

  parent reply	other threads:[~2008-09-26  8:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-26  1:43 Suresh Siddha
2008-09-26  7:39 ` Ingo Molnar
2008-09-26  8:10   ` Yinghai Lu
2008-09-26  8:12   ` Ingo Molnar [this message]
2008-09-26  8:35     ` Ingo Molnar
2008-09-26  9:46       ` [PATCH] x86, pci-hotplug, calgary / rio: fix EBDA ioremap() Ingo Molnar
2008-09-26 11:14         ` Arjan van de Ven
2008-09-27 16:35           ` Ingo Molnar
2008-09-27  7:16 ` [patch] ioremap sanity check to catch mapping requests exceeding the BAR sizes Jeremy Fitzhardinge
2008-09-27 11:21   ` Alan Cox
2008-09-27 14:43     ` Jeremy Fitzhardinge
2008-09-27 15:09       ` Arjan van de Ven
2008-09-27 16:17         ` Jeremy Fitzhardinge
2008-09-27 16:25       ` Alan Cox
2008-09-27 19:24         ` Arjan van de Ven

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=20080926081226.GA8556@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=suresh.b.siddha@intel.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=yhlu.kernel@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome