diff options
author | 2020-01-16 13:00:35 -0400 | |
---|---|---|
committer | 2020-01-25 15:06:00 -0400 | |
commit | 91b60a7128d96244794beb9b324eb39273872da2 (patch) | |
tree | 7cbaa405981a2bbc9b5a1d8817fa61ba840f8bef /tools/perf/scripts/python/export-to-postgresql.py | |
parent | RDMA/cm: Use IBA functions for swapping get/set acessors (diff) | |
download | linux-dev-91b60a7128d96244794beb9b324eb39273872da2.tar.xz linux-dev-91b60a7128d96244794beb9b324eb39273872da2.zip |
RDMA/cm: Use IBA functions for simple structure members
Use a Coccinelle spatch script to replace use of simple CM structure
members with IBA_GET/SET versions. Applied with
$ spatch --sp-file edits.sp --in-place drivers/infiniband/core/cm.c
The spatch file was generated using the template pattern:
@@
expression val;
{struct} *msg;
@@
- msg->{old_name} = val
+ IBA_SET({new_name}, msg, be{bits}_to_cpu(val))
@@
{struct} *msg;
@@
- msg->{old_name}
+ cpu_to_be{bits}(IBA_GET({new_name}, msg))
Iterated for every IBA_CHECK_OFF that isn't a CM_FIELD_MLOC.
And the below iterated over all byte sizes to remove doubled byte swaps:
@@
expression val;
@@
-be{bits}_to_cpu(cpu_to_be{bits}(val))
+val
(and __be_to_cpu and ntoh varients)
Touched up with clang-format after.
Link: https://lore.kernel.org/r/20200116170037.30109-6-jgg@ziepe.ca
Tested-by: Leon Romanovsky <leonro@mellanox.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions