On Wed, Oct 07, 2020 at 07:36:26PM -0700, Joe Perches wrote: > Make changes to use sysfs_emit in the RDMA code as cocci scripts can not > be written to handle _all_ the possible variants of various sprintf family > uses in sysfs show functions. > > While there, make the code more legible and update its style to be more > like the typical kernel styles. > > Miscellanea: > > o Use intermediate pointers for dereferences > o Add and use string lookup functions > o return early when any intermediate call fails so normal return is > at the bottom of the function > o mlx4/mcg.c:sysfs_show_group: use scnprintf to format intermediate strings > > Signed-off-by: Joe Perches <joe@xxxxxxxxxxx> > --- > drivers/infiniband/core/sysfs.c | 60 +++++++------- > drivers/infiniband/hw/cxgb4/provider.c | 5 +- > drivers/infiniband/hw/hfi1/sysfs.c | 38 ++++----- > drivers/infiniband/hw/mlx4/main.c | 5 +- > drivers/infiniband/hw/mlx4/mcg.c | 82 +++++++++++--------- > drivers/infiniband/hw/mlx4/sysfs.c | 47 ++++++----- > drivers/infiniband/hw/mlx5/main.c | 4 +- > drivers/infiniband/hw/mthca/mthca_provider.c | 29 ++++--- > drivers/infiniband/hw/qib/qib_sysfs.c | 45 +++++------ > drivers/infiniband/hw/usnic/usnic_ib_sysfs.c | 66 +++++++--------- > drivers/infiniband/ulp/rtrs/rtrs-clt-sysfs.c | 21 +++-- > drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c | 13 ++-- > drivers/infiniband/ulp/srp/ib_srp.c | 4 + > 13 files changed, 206 insertions(+), 213 deletions(-) Some of thee are a bit exciting, so usnic, hfi1, qib and mlx4 folks should check their bits over the next two weeks Thanks, Jason