Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1178313
| From | Geert Uytterhoeven <geert@linux-m68k.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v5 2/6] arch: unify ioremap prototypes and macro aliases |
| Date | 2015-07-07 12:30 +0200 |
| Message-ID | <pJyiu-4rH-13@gated-at.bofh.it> (permalink) |
| References | (6 earlier) <pHkjE-20T-9@gated-at.bofh.it> <pHktk-24l-17@gated-at.bofh.it> <pHkD1-27B-23@gated-at.bofh.it> <pJxPs-41F-23@gated-at.bofh.it> <pJy8N-4of-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue, Jul 7, 2015 at 12:13 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> 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/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH v5 2/6] arch: unify ioremap prototypes and macro aliases Geert Uytterhoeven <geert@linux-m68k.org> - 2015-07-01 09:20 +0200
Re: [PATCH v5 2/6] arch: unify ioremap prototypes and macro aliases Christoph Hellwig <hch@lst.de> - 2015-07-01 09:30 +0200
Re: [PATCH v5 2/6] arch: unify ioremap prototypes and macro aliases "Luis R. Rodriguez" <mcgrof@suse.com> - 2015-07-07 12:00 +0200
Re: [PATCH v5 2/6] arch: unify ioremap prototypes and macro aliases Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-07-07 12:20 +0200
Re: [PATCH v5 2/6] arch: unify ioremap prototypes and macro aliases Geert Uytterhoeven <geert@linux-m68k.org> - 2015-07-07 12:30 +0200
Re: [PATCH v5 2/6] arch: unify ioremap prototypes and macro aliases Toshi Kani <toshi.kani@hp.com> - 2015-07-08 01:20 +0200
csiph-web