All of lore.kernel.org
 help / color / mirror / Atom feed
From: elfring@users.sourceforge.net (SF Markus Elfring)
To: cocci@systeme.lip6.fr
Subject: [Cocci] SmPL for automatic request_firmware_nowait() conversion
Date: Sat, 21 Jun 2014 08:50:54 +0200	[thread overview]
Message-ID: <53A52B4E.20807@users.sourceforge.net> (raw)
In-Reply-To: <20140621015714.GX4841@wotan.suse.de>

> Obviously I considered writing SmPL for this, but one thing which seemed
> hard was that for after the request_firmware_nowait() we tend to tuck
> away into another new call the rest of the code that was in place in the
> original function after the old request_firmware() call. Is there a way
> to dump all that code into the new routine?

Does the refactoring "Extraction of an interface" fit also to your use case?
http://refactoring.com/catalog/extractInterface.html
http://c2.com/cgi/wiki?ExtractInterface


> I think the hardest thing would be to also move the right set of variables over.

The current syntax for semantic patches has got some limitations for its
expression power. I guess that it is still a software development challenge to
support also variations in involved statements.


> Its hard for me to think of how I can hint to Coccinelle enough information
> about what stuff it needs to move around. I think one hint would be:
> 
>   "Hey all that code that is static and is used *before* and *after* request_firmware()
>    stuff it into the private data structure"

Do you need dynamic source code introspection here?

Regards,
Markus

WARNING: multiple messages have this Message-ID (diff)
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: "Luis R. Rodriguez" <mcgrof@suse.com>
Cc: Coccinelle <cocci@systeme.lip6.fr>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [Cocci] SmPL for automatic request_firmware_nowait() conversion
Date: Sat, 21 Jun 2014 08:50:54 +0200	[thread overview]
Message-ID: <53A52B4E.20807@users.sourceforge.net> (raw)
In-Reply-To: <20140621015714.GX4841@wotan.suse.de>

> Obviously I considered writing SmPL for this, but one thing which seemed
> hard was that for after the request_firmware_nowait() we tend to tuck
> away into another new call the rest of the code that was in place in the
> original function after the old request_firmware() call. Is there a way
> to dump all that code into the new routine?

Does the refactoring "Extraction of an interface" fit also to your use case?
http://refactoring.com/catalog/extractInterface.html
http://c2.com/cgi/wiki?ExtractInterface


> I think the hardest thing would be to also move the right set of variables over.

The current syntax for semantic patches has got some limitations for its
expression power. I guess that it is still a software development challenge to
support also variations in involved statements.


> Its hard for me to think of how I can hint to Coccinelle enough information
> about what stuff it needs to move around. I think one hint would be:
> 
>   "Hey all that code that is static and is used *before* and *after* request_firmware()
>    stuff it into the private data structure"

Do you need dynamic source code introspection here?

Regards,
Markus

  parent reply	other threads:[~2014-06-21  6:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-21  1:57 [Cocci] SmPL for automatic request_firmware_nowait() conversion Luis R. Rodriguez
2014-06-21  1:57 ` Luis R. Rodriguez
2014-06-21  6:37 ` [Cocci] " Julia Lawall
2014-06-21  6:37   ` Julia Lawall
2014-06-21  6:50 ` SF Markus Elfring [this message]
2014-06-21  6:50   ` SF Markus Elfring
2014-06-21 10:52 ` Francois Romieu
2014-06-21 10:52   ` Francois Romieu
2014-06-23 23:21   ` [Cocci] " Luis R. Rodriguez
2014-06-23 23:21     ` Luis R. Rodriguez
2014-06-24  0:32     ` [Cocci] " Luis R. Rodriguez
2014-06-24  0:32       ` Luis R. Rodriguez
2014-06-24 21:58     ` Francois Romieu
2014-06-24 21:58       ` Francois Romieu
2014-06-24 22:06       ` [Cocci] " Luis R. Rodriguez
2014-06-24 22:06         ` Luis R. Rodriguez

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=53A52B4E.20807@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=cocci@systeme.lip6.fr \
    /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.