From: Brian Starkey <brian.starkey@arm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Dan Williams <dan.j.williams@intel.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [RESEND2 PATCH 1/3] memremap: add MEMREMAP_WC flag
Date: Wed, 17 Feb 2016 11:53:48 +0000 [thread overview]
Message-ID: <20160217115347.GA28433@e106950-lin.cambridge.arm.com> (raw)
In-Reply-To: <20160209102300.GB23507@e106950-lin.cambridge.arm.com>
Hi Andrew,
Would you pick these up if I rebase onto linux-next?
How strongly do you feel about the input argument modification vs.
staying in-line with the rest of the function?
Thanks,
Brian
On Tue, Feb 09, 2016 at 10:23:00AM +0000, Brian Starkey wrote:
>Hi Andrew,
>
>Thanks for taking a look,
>
>On Mon, Feb 08, 2016 at 12:03:17PM -0800, Andrew Morton wrote:
>>On Mon, 8 Feb 2016 17:30:50 +0000 Brian Starkey <brian.starkey@arm.com> wrote:
>>The patch generally looks OK to me. It generates rejects against
>>linux-next because of some janitorial changes in memremap.c.
>>
>
>Ah yeah, so it does - sorry. I was hoping this could make it into 4.5,
>but I can rebase onto linux-next if that's better. Annoyingly it only
>conflicts because of a couple of quotation marks.
>
>>
>>>@@ -101,6 +107,11 @@ void *memremap(resource_size_t offset, size_t size, unsigned long flags)
>>> addr = ioremap_wt(offset, size);
>>> }
>>>
>>>+ if (!addr && (flags & MEMREMAP_WC)) {
>>>+ flags &= ~MEMREMAP_WC;
>>>+ addr = ioremap_wc(offset, size);
>>>+ }
>>>+
>>> return addr;
>>> }
>>
>>The modifications of `flags' is unneeded (and the compiler will remove
>>it). And generally the modification of incoming args is a bit nasty
>>IMO - I find it's better to treat them as const - part of the calling
>>environment which can be relied upon to be unaltered as the code
>>evolves.
>>
>
>To be honest I was just mirroring the rest of the function. I guess
>the idea was filtering the different mapping types in case one of the
>'mappers' can handle multiple flags or something. I'll remove it if
>you like, I just thought that extending the functionality in-keeping
>with the current semantics was a better evolution - let me know.
>
>Thanks,
>Brian
next prev parent reply other threads:[~2016-02-17 11:53 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-08 17:30 [RESEND2 PATCH 0/3] Fix kernel panic in dma-coherent Brian Starkey
2016-02-08 17:30 ` [RESEND2 PATCH 1/3] memremap: add MEMREMAP_WC flag Brian Starkey
2016-02-08 18:30 ` Greg Kroah-Hartman
2016-02-09 9:15 ` Brian Starkey
2016-02-16 11:14 ` Brian Starkey
2016-02-17 0:43 ` Greg Kroah-Hartman
2016-02-17 10:07 ` Brian Starkey
2016-02-08 20:03 ` Andrew Morton
2016-02-09 10:23 ` Brian Starkey
2016-02-17 11:53 ` Brian Starkey [this message]
2016-02-17 19:02 ` Andrew Morton
2016-02-08 17:30 ` [RESEND2 PATCH 2/3] drivers: dma-coherent: use MEMREMAP_WC for DMA_MEMORY_MAP Brian Starkey
2016-02-08 17:30 ` [RESEND2 PATCH 3/3] drivers: dma-coherent: use memset_io for DMA_MEMORY_IO mappings Brian Starkey
2016-02-08 17:50 ` [RESEND2 PATCH 0/3] Fix kernel panic in dma-coherent Mark Rutland
2016-02-08 17:59 ` Robin Murphy
2016-02-08 18:04 ` Mark Rutland
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=20160217115347.GA28433@e106950-lin.cambridge.arm.com \
--to=brian.starkey@arm.com \
--cc=akpm@linux-foundation.org \
--cc=catalin.marinas@arm.com \
--cc=dan.j.williams@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome