public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Jes Sorensen <jes@wildopensource.com>
Cc: Andrew Morton <akpm@osdl.org>,
	matthew@wil.cx, linux-ia64@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [patch -mm series] ia64 specific /dev/mem handlers
Date: Wed, 23 Feb 2005 22:34:04 +0000	[thread overview]
Message-ID: <20050223223404.GA21383@infradead.org> (raw)
In-Reply-To: <yq0sm3negtb.fsf@jaguar.mkp.net>

> +		page = pfn_to_page(p >> PAGE_SHIFT);
> +		/*
> +		 * On ia64 if a page has been mapped somewhere as
> +		 * uncached, then it must also be accessed uncached
> +		 * by the kernel or data corruption may occur
> +		 */
> +#ifdef ARCH_HAS_TRANSLATE_MEM_PTR
> +		ptr = arch_translate_mem_ptr(page, p);
> +#else
> +		ptr = __va(p);
> +#endif

Please remove the ifdef by letting every architecture implement a
arch_translate_mem_ptr (and give it a saner name while you're at it).

Also shouldn't the pfn_to_page be done inside arch_translate_mem_ptr?
The struct page * isn't used anywhere else.

> +	if (!range_is_allowed(p, p + count))

isn't the name a little too generic?

> +
> +	written = 0;
> +
> +#if defined(__sparc__) || (defined(__mc68000__) && defined(CONFIG_MMU))
> +	/* we don't have page 0 mapped on sparc and m68k.. */
> +	if (p < PAGE_SIZE) {
> +		unsigned long sz = PAGE_SIZE - p;
> +		if (sz > count)
> +			sz = count; 
> +		/* Hmm. Do something? */
> +		buf += sz;
> +		p += sz;
> +		count -= sz;
> +		written += sz;
> +	}
> +#endif

While you're at it replace the ifdef mania with a #ifdef
__HAVE_ARCH_PAGE_ZERO_MAPPED or something similar.


  reply	other threads:[~2005-02-23 22:34 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-22  9:52 [patch -mm series] ia64 specific /dev/mem handlers Jes Sorensen
2005-02-22 10:03 ` Andrew Morton
2005-02-22 12:08   ` Andi Kleen
2005-02-22 14:41   ` Jes Sorensen
2005-02-22 17:52     ` Matthew Wilcox
2005-02-22 19:25       ` Andrew Morton
2005-02-22 19:35         ` Dave Hansen
2005-02-22 21:38           ` Jes Sorensen
2005-02-23  0:48             ` Dave Hansen
2005-02-22 21:34         ` Jes Sorensen
2005-02-22 22:39         ` Jes Sorensen
2005-02-22 23:34           ` Andrew Morton
2005-02-23 10:01             ` Jes Sorensen
2005-02-23 22:34               ` Christoph Hellwig [this message]
2005-02-24 16:11                 ` Jes Sorensen
2005-03-10  6:55                   ` Andrew Morton
2005-03-10 13:49                     ` Jes Sorensen
2005-02-22 22:03 ` Arjan van de Ven
2005-02-22 22:30   ` Jes Sorensen
2005-02-22 22:42     ` Arjan van de Ven
2005-02-23  8:12       ` Jes Sorensen
2005-02-23  8:24         ` Arjan van de Ven
2005-03-03 11:37 ` Andrew Morton
2005-03-03 12:53   ` Jes Sorensen
2005-03-04 12:26     ` Jes Sorensen
  -- strict thread matches above, loose matches on Subject: below --
2005-02-22 18:05 Luck, Tony

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=20050223223404.GA21383@infradead.org \
    --to=hch@infradead.org \
    --cc=akpm@osdl.org \
    --cc=jes@wildopensource.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@wil.cx \
    /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