Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756816AbbGGK1w (ORCPT ); Tue, 7 Jul 2015 06:27:52 -0400 Received: from mail-oi0-f52.google.com ([209.85.218.52]:33718 "EHLO mail-oi0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754478AbbGGK1o (ORCPT ); Tue, 7 Jul 2015 06:27:44 -0400 MIME-Version: 1.0 In-Reply-To: <20150707101330.GJ7557@n2100.arm.linux.org.uk> References: <20150622081028.35954.89885.stgit@dwillia2-desk3.jf.intel.com> <20150622082427.35954.73529.stgit@dwillia2-desk3.jf.intel.com> <20150622161002.GB8240@lst.de> <20150701062352.GA3739@lst.de> <20150701065948.GA4355@lst.de> <20150701072828.GA4881@lst.de> <20150707095012.GQ7021@wotan.suse.de> <20150707101330.GJ7557@n2100.arm.linux.org.uk> Date: Tue, 7 Jul 2015 12:27:43 +0200 X-Google-Sender-Auth: eoppIyxJzBicBOAJXH11O9aA9TU Message-ID: Subject: Re: [PATCH v5 2/6] arch: unify ioremap prototypes and macro aliases From: Geert Uytterhoeven To: Russell King - ARM Linux Cc: "Luis R. Rodriguez" , Christoph Hellwig , Andy Lutomirski , Benjamin Herrenschmidt , Julia Lawall , Dan Williams , Arnd Bergmann , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Thomas Gleixner , Ross Zwisler , Andrew Morton , Juergen Gross , X86 ML , "Kani, Toshimitsu" , "linux-nvdimm@lists.01.org" , Konrad Rzeszutek Wilk , "linux-kernel@vger.kernel.org" , Stefan Bader , Linux MM , Ralf Baechle , Henrique de Moraes Holschuh , Michael Ellerman , Tejun Heo , Paul Mackerras , "Luis R. Rodriguez" , "linux-arm-kernel@lists.infradead.org" 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: 1535 Lines: 34 On Tue, Jul 7, 2015 at 12:13 PM, Russell King - ARM Linux wrote: > Another issue is... the use of memcpy()/memset() directly on memory > returned from ioremap*(). The pmem driver does this. This fails sparse > checks. However, years ago, x86 invented the memcpy_fromio()/memcpy_toio() > memset_io() functions, which took a __iomem pointer (which /presumably/ > means they're supposed to operate on the memory associated with an > ioremap'd region.) > > Should these functions always be used for mappings via ioremap*(), and > the standard memcpy()/memset() be avoided? To me, that sounds like a > very good thing, because that gives us more control over the > implementation of the functions used to access ioremap'd regions, > and the arch can decide to prevent GCC inlining its own memset() or > memcpy() code if desired. Yes they should. Not doing that is a typical portability bug (works on x86, not everywhere). Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds -- 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/