All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: Gerd Hoffmann <kraxel@suse.de>
Cc: Ky Srinivasan <ksrinivasan@novell.com>, xen-devel@lists.xensource.com
Subject: Re: PV drivers for HVM guests
Date: 04 Oct 2006 17:54:07 +0200	[thread overview]
Message-ID: <p733ba413hc.fsf@verdi.suse.de> (raw)
In-Reply-To: <452394E3.6030000@suse.de>

Gerd Hoffmann <kraxel@suse.de> writes:

> Muli Ben-Yehuda wrote:
> >> A shim layer (i.e., a set of compat macros) that avoids ifdef'ing
> >> the core driver code is definitely the way to go.
> > 
> > FWIW, neither option has a chance of being accepted upstream.
> 
> Exactly thats why a shim layer is the way to go (if possible, doesn't
> work for all changes but for most).  Did that that quite some time while
> maintaining the v4l subsystem.  Making driver source code use the
> 2.6.latest conventions and have some compat.h header file full of stuff
> like this ...
> 
>   #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,xx)
>   # define foo gryyz
>   #endif
> 
> or (better if possible as it catches distro backports, which does happen
> now and then for compiling recent drivers on old distro kernels).
> 
>   #ifndef bar
>   # define bar xyzzy
>   #endif
> 
> nicely separates out the compat bits.  It makes the code more readable
> and also is less work when submitting code upstream.

I hate to point out the obvious, but often when calls get renamed upstream
it is actually because the semantics changed subtly (the point of the rename
was to enforce a audit and proper fix of the driver)  Typically then
using define bar xyz is then not the right thing to do. 

Especially when you do

#define oldfunctionname newfunctionname

without any translation you very likely have a bug.

A shim layer can be the right thing to do still, but you have to be very
careful to not miss such a semantics change.

-Andi

  reply	other threads:[~2006-10-04 15:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-03 20:31 PV drivers for HVM guests Ky Srinivasan
2006-10-03 22:19 ` Andrew D. Ball
2006-10-03 22:31 ` Steve Ofsthun
2006-10-04  7:56 ` Keir Fraser
2006-10-04  8:15   ` Muli Ben-Yehuda
2006-10-04  8:17     ` Keir Fraser
2006-10-04 11:02     ` Gerd Hoffmann
2006-10-04 15:54       ` Andi Kleen [this message]
2006-10-04 10:24 ` Steven Smith
2006-10-05 15:21 ` Ian Campbell
2006-10-05 16:47   ` Ky Srinivasan
2006-10-10  8:00   ` DOI Tsunehisa
2006-10-11 10:46     ` DOI Tsunehisa
2006-10-13  2:00       ` DOI Tsunehisa
2006-10-13  6:55         ` Ian Campbell
  -- strict thread matches above, loose matches on Subject: below --
2006-10-04 18:40 Ky Srinivasan
2006-10-04 18:42 Ky Srinivasan
2006-10-05 14:59 ` Andrew D. Ball
2006-10-05 15:13   ` Ky Srinivasan
2006-10-04 18:45 Ky Srinivasan
2006-10-04 18:47 Ky Srinivasan
2006-10-04 18:50 Ky Srinivasan

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=p733ba413hc.fsf@verdi.suse.de \
    --to=ak@suse.de \
    --cc=kraxel@suse.de \
    --cc=ksrinivasan@novell.com \
    --cc=xen-devel@lists.xensource.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.