Commit 65db56d
iavf: field get conversion
Refactor the iavf driver to use FIELD_GET() for mask and shift reads,
which reduces lines of code and adds clarity of intent.
This code was generated by the following coccinelle/spatch script and
then manually repaired in a later patch.
@get@
constant shift,mask;
type T;
expression a;
@@
-((T)((a) & mask) >> shift)
+FIELD_GET(mask, a)
and applied via:
spatch --sp-file field_prep.cocci --in-place --dir \
drivers/net/ethernet/intel/
Cc: Julia Lawall <Julia.Lawall@inria.fr>
Reviewed-by: Marcin Szycik <marcin.szycik@linux.intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>1 parent 6258980 commit 65db56d
2 files changed
Lines changed: 8 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1017 | 1017 | | |
1018 | 1018 | | |
1019 | 1019 | | |
1020 | | - | |
1021 | | - | |
| 1020 | + | |
1022 | 1021 | | |
1023 | 1022 | | |
1024 | 1023 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
989 | 989 | | |
990 | 990 | | |
991 | 991 | | |
992 | | - | |
993 | | - | |
994 | | - | |
995 | | - | |
996 | | - | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
997 | 995 | | |
998 | 996 | | |
999 | 997 | | |
| |||
1534 | 1532 | | |
1535 | 1533 | | |
1536 | 1534 | | |
1537 | | - | |
1538 | | - | |
| 1535 | + | |
1539 | 1536 | | |
1540 | 1537 | | |
1541 | 1538 | | |
| |||
1582 | 1579 | | |
1583 | 1580 | | |
1584 | 1581 | | |
1585 | | - | |
1586 | | - | |
| 1582 | + | |
1587 | 1583 | | |
1588 | 1584 | | |
1589 | 1585 | | |
| |||
2291 | 2287 | | |
2292 | 2288 | | |
2293 | 2289 | | |
2294 | | - | |
2295 | | - | |
| 2290 | + | |
2296 | 2291 | | |
2297 | 2292 | | |
2298 | 2293 | | |
| |||
2468 | 2463 | | |
2469 | 2464 | | |
2470 | 2465 | | |
2471 | | - | |
2472 | | - | |
| 2466 | + | |
2473 | 2467 | | |
2474 | 2468 | | |
2475 | 2469 | | |
| |||
0 commit comments