netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/11] use ether_addr_equal_64bits
@ 2013-12-30 18:14 Julia Lawall
  2013-12-30 18:14 ` [PATCH 1/11] rt2x00: " Julia Lawall
                   ` (11 more replies)
  0 siblings, 12 replies; 44+ messages in thread
From: Julia Lawall @ 2013-12-30 18:14 UTC (permalink / raw)
  To: ath9k-devel
  Cc: kernel-janitors, ath5k-devel, linux-kernel, netdev,
	linux-wireless, John W. Linville, users

Ether_addr_equal_64bits is more efficient than ether_addr_equal, and can be
used when each argument is an array within a structure that contains at
least two bytes of data beyond the array.

The semantic patch that makes this change is as follows.  To give
moderately good results, this semantic patch requires the spatch options
--recursive-includes and --relax-include-path.  These options make spatch
quite slow.  The results are also very incomplete.  In particular, there is
no result if the structure definition cannot be found or if one of the
arguments is a pointer.  The ocaml code prints some information justifying
the transformation.

// <smpl>
@pre@
expression *e;
position p;
@@

ether_addr_equal@p(...,e,...)

@r@
identifier T;
struct T eth;
identifier fld;
identifier T1;
struct T1 eth1;
identifier fld1;
position p!=pre.p;
@@

ether_addr_equal@p(eth.fld, eth1.fld1)

@ok@
identifier r.T;
type t1, t2;
identifier r.fld, fld2;
position p;
@@

struct T@p { ...
    t1 fld[...];
    t2 fld2;
    ...
  };

@ok1@
identifier r.T1;
type t1, t2;
identifier r.fld1, fld2;
position p1;
@@

struct T1@p1 { ...
    t1 fld1[...];
    t2 fld2;
    ...
  };

@script:ocaml@
rp << r.p;
okp << ok.p;
okp1 << ok1.p1;
t << r.T;
t1 << r.T1;
@@

let rp = List.hd rp in
let okp = List.hd okp in
let okp1 = List.hd okp1 in
Printf.printf "## %s: struct %s defined in %s\n" rp.file t okp.file;
Printf.printf "## %s: struct %s defined in %s\n" rp.file t1 okp1.file;
flush stdout

@depends on ok && ok1@
position r.p;
@@

-ether_addr_equal@p
+ether_addr_equal_64bits
  (...)
// </smpl>

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

end of thread, other threads:[~2014-01-17 22:43 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-30 18:14 [PATCH 0/11] use ether_addr_equal_64bits Julia Lawall
2013-12-30 18:14 ` [PATCH 1/11] rt2x00: " Julia Lawall
2013-12-31 16:44   ` Gertjan van Wingerde
2013-12-30 18:14 ` [PATCH 2/11] ath5k: " Julia Lawall
2013-12-30 18:14 ` [PATCH 3/11] mac80211: " Julia Lawall
2013-12-30 18:10   ` Christian Lamparter
2013-12-30 18:15 ` [PATCH 4/11] " Julia Lawall
2013-12-30 18:56   ` Johannes Berg
2013-12-30 19:58     ` Julia Lawall
2013-12-30 21:25       ` Johannes Berg
2013-12-30 21:57         ` Henrique de Moraes Holschuh
     [not found]           ` <20131230215701.GA4938-ZGHd14iZgfaRjzvQDGKj+xxZW9W5cXbT@public.gmane.org>
2013-12-30 23:13             ` Johannes Berg
2013-12-30 23:17               ` Joe Perches
2013-12-31  6:32                 ` Julia Lawall
     [not found]                   ` <alpine.DEB.2.02.1312310726540.1930-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org>
2013-12-31 15:54                     ` Ben Greear
2013-12-31 16:09                       ` Julia Lawall
2013-12-31 16:27                         ` Ben Greear
2013-12-31 16:40                           ` Julia Lawall
2014-01-06  9:05                             ` Johannes Berg
     [not found]                               ` <1388999147.5891.2.camel-8Nb76shvtaUJvtFkdXX2HixXY32XiHfO@public.gmane.org>
2014-01-06  9:09                                 ` Julia Lawall
2014-01-06 10:17                                   ` Johannes Berg
2014-01-06  8:48                 ` Julia Lawall
2014-01-06  8:59                   ` Joe Perches
2014-01-06  9:04                     ` Julia Lawall
2014-01-06  9:07                       ` Johannes Berg
2014-01-06  9:20                         ` Julia Lawall
2013-12-31  6:26               ` Emmanuel Grumbach
2014-01-06  9:24                 ` Geert Uytterhoeven
2014-01-06  9:35                   ` Julia Lawall
2014-01-06 15:18                   ` Eric Dumazet
2014-01-06 10:48               ` Dan Carpenter
2014-01-17 10:18                 ` Dan Carpenter
2013-12-30 18:15 ` [PATCH 5/11] mwl8k: " Julia Lawall
2013-12-30 18:15 ` [PATCH 6/11] rtlwifi: " Julia Lawall
2013-12-30 21:08   ` Larry Finger
2013-12-30 18:15 ` [PATCH 7/11] iwlegacy: " Julia Lawall
2013-12-30 18:15 ` [PATCH 8/11] " Julia Lawall
2013-12-30 18:15 ` [PATCH 9/11] ipw2x00: " Julia Lawall
2013-12-30 18:15 ` [PATCH 10/11] at76c50x-usb: " Julia Lawall
2013-12-30 18:15 ` [PATCH 11/11] carl9170: " Julia Lawall
2013-12-30 18:10   ` Christian Lamparter
2014-01-17 21:24 ` [PATCH 0/11] " Pavel Machek
2014-01-17 22:02   ` Oleksij Rempel
2014-01-17 22:43     ` Pavel Machek

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).