netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* SmPL for automatic request_firmware_nowait() conversion
@ 2014-06-21  1:57 Luis R. Rodriguez
  2014-06-21  6:37 ` [Cocci] " Julia Lawall
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Luis R. Rodriguez @ 2014-06-21  1:57 UTC (permalink / raw)
  To: cocci; +Cc: linux-kernel, netdev

I was just porting over an ethernet driver [0] to use request_firmware_nowait()
since firmware loading seems can take over a minute on one device, while
at it I noticed no other ethernet drivers yet use this API so figure
this may be a trend coming if devices are getting as complex as cxgb4.
The cxgb4 driver happens to even use the firmware API 3 times!

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? I think the hardest thing
would be to also move the right set of variables over. In the third
patch in this series for example [1] there was a state variable that
I moved from beign static over to the ethernet private data structure.
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"

We'd have to infer the private data structure but that's easy and I already know
that's possible. Is this possible? The only other challenge I thought
might be tough would be to come up with are rasonable call for the
completion call, but I guess we can use the original routine name
where request_firmware() was being used and postfix _completion or something.

netdev: how worthy is this effort?

[0] https://lkml.org/lkml/2014/6/20/688
[1] https://lkml.org/lkml/2014/6/20/691
 
  Luis

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-06-24 22:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-21  1:57 SmPL for automatic request_firmware_nowait() conversion Luis R. Rodriguez
2014-06-21  6:37 ` [Cocci] " Julia Lawall
2014-06-21  6:50 ` SF Markus Elfring
2014-06-21 10:52 ` Francois Romieu
2014-06-23 23:21   ` Luis R. Rodriguez
2014-06-24  0:32     ` [Cocci] " Luis R. Rodriguez
2014-06-24 21:58     ` Francois Romieu
2014-06-24 22:06       ` Luis R. Rodriguez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).