Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752322AbbEFSOa (ORCPT ); Wed, 6 May 2015 14:14:30 -0400 Received: from mail-ie0-f179.google.com ([209.85.223.179]:35590 "EHLO mail-ie0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751036AbbEFSO3 (ORCPT ); Wed, 6 May 2015 14:14:29 -0400 MIME-Version: 1.0 In-Reply-To: <20150506125800.GA23669@gmail.com> References: <20150506125800.GA23669@gmail.com> Date: Wed, 6 May 2015 11:14:28 -0700 X-Google-Sender-Auth: ORV31TNdzfHtvNf5fY313LkV904 Message-ID: Subject: Re: [GIT PULL] x86 fixes From: Linus Torvalds To: Ingo Molnar Cc: Linux Kernel Mailing List , Thomas Gleixner , "H. Peter Anvin" , Andrew Morton Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1539 Lines: 44 Ugh, I pulled, but: On Wed, May 6, 2015 at 5:58 AM, Ingo Molnar wrote: > > Ingo Molnar (1): > x86/mm: Clean up types in xlate_dev_mem_ptr() > > diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c > index fdf617c00e2f..4bf037b20f47 100644 > --- a/arch/x86/mm/ioremap.c > +++ b/arch/x86/mm/ioremap.c > @@ -332,18 +332,20 @@ EXPORT_SYMBOL(iounmap); > */ > void *xlate_dev_mem_ptr(phys_addr_t phys) > { > + unsigned long start = phys & PAGE_MASK; > + unsigned long offset = phys & ~PAGE_MASK; > + unsigned long vaddr; That "unsigned long vaddr" is just stupid and not a cleanup. It causes two pointless casts: > + vaddr = (unsigned long)ioremap_cache(start, PAGE_SIZE); > + /* Only add the offset on success and return NULL if the ioremap() failed: */ > + if (vaddr) > + vaddr += offset; > > + return (void *)vaddr; neither of which is helpful in the least. And the "vaddr += offset" would work equally well in "void *", gcc is perfectly happy to treat "void *" arithmetic as byte offsets, it's both documented and already extensively used in the kernel. So the cleanup to use "start/offset" is a good cleanup, but you should have kept "addr" as a pointer. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/