All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
	jgross@suse.com, roland@purestorage.com,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: [patch for 4.0] x86: silence warning in /dev/mem support
Date: Thu, 16 Apr 2015 10:04:40 +0200	[thread overview]
Message-ID: <20150416080440.GA507@amd> (raw)

The compiler is right, the code is tricky, but it is also correct
AFAICT.

Signed-off-by: Pavel Machek <pavel@ucw.cz>

diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index fdf617c..8a8dce8 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -341,7 +341,7 @@ void *xlate_dev_mem_ptr(phys_addr_t phys)
 
 	addr = (void __force *)ioremap_cache(start, PAGE_SIZE);
 	if (addr)
-		addr = (void *)((unsigned long)addr | (phys & ~PAGE_MASK));
+		addr = (void *)((unsigned long)addr | (unsigned long) (phys & ~PAGE_MASK));
 
 	return addr;
 }


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

             reply	other threads:[~2015-04-16  8:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-16  8:04 Pavel Machek [this message]
2015-04-16 10:09 ` [patch for 4.0] x86: silence warning in /dev/mem support Ingo Molnar
2015-04-16 10:15   ` Pavel Machek
2015-04-17  8:39     ` Ingo Molnar
2015-04-17  8:48       ` Pavel Machek
2015-04-20  6:52         ` Ingo Molnar
2015-04-20 10:13 ` [tip:x86/urgent] x86/mm: Clean up types in xlate_dev_mem_ptr() tip-bot for Ingo Molnar

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=20150416080440.GA507@amd \
    --to=pavel@ucw.cz \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=roland@purestorage.com \
    --cc=tglx@linutronix.de \
    /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.