Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1330032

Re: [RESEND2 PATCH 1/3] memremap: add MEMREMAP_WC flag

From Brian Starkey <brian.starkey@arm.com>
Newsgroups linux.kernel
Subject Re: [RESEND2 PATCH 1/3] memremap: add MEMREMAP_WC flag
Date 2016-02-09 11:30 +0100
Message-ID <r0dIt-2Hb-7@gated-at.bofh.it> (permalink)
References <qZXX3-8qz-11@gated-at.bofh.it> <qZXX4-8qz-27@gated-at.bofh.it> <r00ie-1J1-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RESEND2 PATCH 1/3] memremap: add MEMREMAP_WC flag Brian Starkey <brian.starkey@arm.com> - 2016-02-08 18:40 +0100
  Re: [RESEND2 PATCH 1/3] memremap: add MEMREMAP_WC flag Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-08 19:40 +0100
    Re: [RESEND2 PATCH 1/3] memremap: add MEMREMAP_WC flag Brian Starkey <brian.starkey@arm.com> - 2016-02-09 10:20 +0100
      Re: [RESEND2 PATCH 1/3] memremap: add MEMREMAP_WC flag Brian Starkey <brian.starkey@arm.com> - 2016-02-16 12:20 +0100
        Re: [RESEND2 PATCH 1/3] memremap: add MEMREMAP_WC flag Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-17 01:50 +0100
          Re: [RESEND2 PATCH 1/3] memremap: add MEMREMAP_WC flag Brian Starkey <brian.starkey@arm.com> - 2016-02-17 11:10 +0100
  Re: [RESEND2 PATCH 1/3] memremap: add MEMREMAP_WC flag Andrew Morton <akpm@linux-foundation.org> - 2016-02-08 21:10 +0100
    Re: [RESEND2 PATCH 1/3] memremap: add MEMREMAP_WC flag Brian Starkey <brian.starkey@arm.com> - 2016-02-09 11:30 +0100
      Re: [RESEND2 PATCH 1/3] memremap: add MEMREMAP_WC flag Brian Starkey <brian.starkey@arm.com> - 2016-02-17 13:00 +0100
        Re: [RESEND2 PATCH 1/3] memremap: add MEMREMAP_WC flag Andrew Morton <akpm@linux-foundation.org> - 2016-02-17 20:10 +0100

csiph-web