public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Matt Mackall <mpm@selenic.com>,
	"Bryan O'Sullivan" <bos@pathscale.com>,
	Roland Dreier <rdreier@cisco.com>,
	linux-kernel@vger.kernel.org, akpm@osdl.org, hch@infradead.org
Subject: Re: [PATCH 1 of 3] Introduce __memcpy_toio32
Date: Sat, 31 Dec 2005 22:24:40 +0100	[thread overview]
Message-ID: <20051231212440.GO3811@stusta.de> (raw)
In-Reply-To: <Pine.LNX.4.64.0512301559160.3249@g5.osdl.org>

On Fri, Dec 30, 2005 at 04:23:46PM -0800, Linus Torvalds wrote:
>...
> > > Where's the problem with the __HAVE_ARCH_* mechanism?
>...
> And no, I don't like the __HAVE_ARCH_xxx mechanisms at all. They are 
> pointless, and hard to follow. If an architecture wants to use a generic 
> mechanism, it should do one of the following (or a combination):
> 
>  - use the config file mechanism, and use
> 
> 	obj-$(CONFIG_GENERIC_FOO) += generic-foo.c
> 
>    in a Makefile to link in the generic version.
> 
>    Examples: CONFIG_RWSEM_GENERIC_SPINLOCK.
> 
>  - just include the generic header from its own header, eg just do a
> 
> 	#include <asm-generic/div64.h>
> 
>    or similar.
> 
> Now, the latter in particular is very easy to follow: if you look into the 
> <asm/div64.h> file and see that it just includes <asm-generic/div64.h>, 
> it's very obvious what is going on and where to find the real 
> implementation. You never have to wonder what the indirection means. 
>...
> Now, the CONFIG_GENERIC_FOO thing is a bit less obvious, and you may have 
> to know about that config option in order to realize that a particular 
> architecture is using a generic library routine, but at least with those 
> Kconfig options, the language to describe them is clean these days, and 
> it's _the_ standard way to express configuration information. So it may be 
> a bit subtler and more indirect, but once you get used to it, it too is 
> very clean.
>...

OK, this I don't have any problem with.

I'm not yet fully convinced that __HAVE_ARCH_xxx is really that bad, but 
your proposed solution doesn't have the problems I had in mind.

What is OK:
  obj-$(CONFIG_GENERIC_FOO) += generic-foo.o

What is not OK:
  lib-y += generic-foo.o

The latter has the following disadvantages:
- it's non-obvious whether the object actually gets included in the 
  kernel
- if the contents of generic-foo.o is only used in modules, 
  generic-foo.o is _not_ included in the kernel resulting in an
  obvious breakage

> 			Linus

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


  parent reply	other threads:[~2005-12-31 21:24 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-27 23:41 [PATCH 0 of 3] Add memcpy_toio32, a 32-bit MMIO copy routine Bryan O'Sullivan
2005-12-27 23:41 ` [PATCH 1 of 3] Introduce __memcpy_toio32 Bryan O'Sullivan
2005-12-28  1:10   ` Roland Dreier
2005-12-28 14:40     ` Bryan O'Sullivan
2005-12-28 14:51       ` Matt Mackall
2005-12-30 23:46         ` Adrian Bunk
2005-12-30 23:44           ` Matt Mackall
2005-12-31  0:23             ` Linus Torvalds
2005-12-31  0:31               ` (OT) " Jan Engelhardt
2005-12-31  0:44                 ` Linus Torvalds
2005-12-31 21:24               ` Adrian Bunk [this message]
2005-12-28 19:23       ` Roland Dreier
2005-12-28  1:11   ` Roland Dreier
2005-12-28  4:07     ` Matt Mackall
2005-12-28  3:52   ` Matt Mackall
2005-12-28 14:47     ` Bryan O'Sullivan
2005-12-28 14:55       ` Matt Mackall
2005-12-28 15:18     ` Geert Uytterhoeven
2005-12-28 15:52       ` Bryan O'Sullivan
2005-12-27 23:41 ` [PATCH 2 of 3] memcpy32 for x86_64 Bryan O'Sullivan
2005-12-28  4:22   ` Matt Mackall
2005-12-28  7:54     ` Denis Vlasenko
2005-12-28 14:52     ` Bryan O'Sullivan
2006-01-06  9:12   ` Pavel Machek
2006-01-06 16:02     ` Bryan O'Sullivan
2005-12-27 23:41 ` [PATCH 3 of 3] Add memcpy_toio32 to each arch Bryan O'Sullivan
     [not found] <200512280603.jBS63WGB031117@taverner.CS.Berkeley.EDU>
2005-12-28  6:20 ` [PATCH 1 of 3] Introduce __memcpy_toio32 Matt Mackall

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=20051231212440.GO3811@stusta.de \
    --to=bunk@stusta.de \
    --cc=akpm@osdl.org \
    --cc=bos@pathscale.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    --cc=rdreier@cisco.com \
    --cc=torvalds@osdl.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