From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757168AbbDPIEx (ORCPT ); Thu, 16 Apr 2015 04:04:53 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:60591 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752642AbbDPIEn (ORCPT ); Thu, 16 Apr 2015 04:04:43 -0400 Date: Thu, 16 Apr 2015 10:04:40 +0200 From: Pavel Machek 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 Message-ID: <20150416080440.GA507@amd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The compiler is right, the code is tricky, but it is also correct AFAICT. Signed-off-by: Pavel Machek 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