All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	backports@vger.kernel.org
Subject: Re: [PATCH RFC 1/2] Add required changes for audio packports
Date: Fri, 18 Sep 2015 15:09:57 +0200	[thread overview]
Message-ID: <1442581797.2168.12.camel@sipsolutions.net> (raw)
In-Reply-To: <55FC0AFD.9010409@linux.intel.com>

On Fri, 2015-09-18 at 08:00 -0500, Pierre-Louis Bossart wrote:
> 
> This was a first-order ugly backport to revert to what existed 
> before.

Fair enough.

> I have no idea what an spatch is,

A semantic patch (coccinelle)

>  if there is an example of such a 
> 'suitable data structure manipulation' I am all ears.

I don't have an example, but imagine you have this:

old code:
 my_read_data(struct my *my, void *out_buf, int len)

new code:
 my_read_data_sg(struct my *my, struct scatterlist *sg)


Then on old kernels you could do

backport_my_read_data(struct my *my, void *out_buf, int len)
{
 struct scatterlist sg;
 struct sg_ent ent;

 sg.nents = 1;
 sg.ents = &ent;
 ent.data = out_buf;
 ent.len = len;
 my_read_data_sg(&my, &sg);
}

(this absolutely won't compile, just to illustrate the idea)

That basically reduces the old function pointer to the new one with
static code inbetween, and then that can be embedded in an spatch that
automatically adds the wrapper where needed.

johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in

  reply	other threads:[~2015-09-18 13:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-17 21:47 [PATCH RFC 0/2] addition of audio to backports Pierre-Louis Bossart
2015-09-17 21:47 ` [PATCH RFC 1/2] Add required changes for audio packports Pierre-Louis Bossart
2015-09-18  7:15   ` Johannes Berg
2015-09-18 13:00     ` Pierre-Louis Bossart
2015-09-18 13:09       ` Johannes Berg [this message]
2015-09-17 21:47 ` [PATCH RFC 2/2] add script to enable audio backport Pierre-Louis Bossart
2015-09-18  7:17   ` Johannes Berg
2015-09-18 13:06     ` Pierre-Louis Bossart
2015-09-18 13:11       ` Johannes Berg

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=1442581797.2168.12.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=backports@vger.kernel.org \
    --cc=pierre-louis.bossart@linux.intel.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.