Skip to content

coresight: Reduce duplicated sysfs accessors

James Clark linux-arm-kernel lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 6 repliesIn review
  2. v14 patches 6 repliesSuperseded

Changes in v2 from the cover letter

* Keep existing signed offset value types until the very last commit and then remove them all at once

* Also split out usages of read_pair() and read32() into separate functions in the last commit

* Whitespace fixes

* Replaced any touched scnprintf() with sysfs_emit()

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5coresight: Remove unused function parameterdrivers/hwtracing/coresight/coresight-priv.h+4 -121 reply
2/5coresight: Simplify sysfs accessors by using csdev_access abstractiondrivers/hwtracing/coresight/coresight-catu.c drivers/hwtracing/coresight/coresight-etb10.c drivers/hwtracing/coresight/coresight-etm3x-sysfs.c +5 more+79 -801 reply
3/5coresight: Re-use same function for similar sysfs register accessorsdrivers/hwtracing/coresight/coresight-catu.c drivers/hwtracing/coresight/coresight-core.c drivers/hwtracing/coresight/coresight-etb10.c +5 more+91 -1311 reply
4/5coresight: cti-sysfs: Re-use same functions for similar sysfs register accessorsdrivers/hwtracing/coresight/coresight-cti-sysfs.c drivers/hwtracing/coresight/coresight-priv.h+91 -1271 reply
5/5coresight: Make new csdev_access offsets unsigneddrivers/hwtracing/coresight/coresight-catu.h drivers/hwtracing/coresight/coresight-core.c drivers/hwtracing/coresight/coresight-priv.h +2 more+47 -451 reply

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchMike Leach
1/5R-b
2/5R-b
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/5] coresight: Reduce duplicated sysfs accessors

Changes since v1:

* Keep existing signed offset value types until the very last commit and then remove them all at once

* Also split out usages of read_pair() and read32() into separate functions in the last commit

* Whitespace fixes

* Replaced any touched scnprintf() with sysfs_emit()

======

The intent of this change is to reduce the large number identical of functions created by macros for sysfs accessors. It's possible to re-use the same function but pass in the register to access as an argument. This reduces the size of the coresight modules folder by 244KB.

The first two patches are refactors to simplify and remove some dead code, and the second two are the changes to use a shared function.

Testing
=======

No changes in any of the outputs:

cat /sys/bus/coresight/devices/*/mgmt/* > before.txt cat /sys/bus/coresight/devices/*/mgmt/* > after.txt diff before.txt after.txt

With the following modules loaded:

ls /sys/bus/coresight/devices/

  etm0  etm2  funnel0  funnel2  replicator0  tmc_etf0  tmc_etf2  tpiu0
  etm1  etm3  funnel1  funnel3  stm0         tmc_etf1  tmc_etr0

James Clark (5):
coresight: Remove unused function parameter
coresight: Simplify sysfs accessors by using csdev_access abstraction
coresight: Re-use same function for similar sysfs register accessors
coresight: cti-sysfs: Re-use same functions for similar sysfs register
accessors
coresight: Make new csdev_access offsets unsigned

 drivers/hwtracing/coresight/coresight-catu.c  |  27 +--
 drivers/hwtracing/coresight/coresight-catu.h  |   8 +-
 drivers/hwtracing/coresight/coresight-core.c  |  28 +++
 .../hwtracing/coresight/coresight-cti-sysfs.c | 213 +++++++-----------
 drivers/hwtracing/coresight/coresight-etb10.c |  28 +--
 .../coresight/coresight-etm3x-sysfs.c         |  34 +--
 drivers/hwtracing/coresight/coresight-priv.h  |  74 +++---
 .../coresight/coresight-replicator.c          |  10 +-
 drivers/hwtracing/coresight/coresight-stm.c   |  40 +---
 .../hwtracing/coresight/coresight-tmc-core.c  |  48 ++--
 drivers/hwtracing/coresight/coresight-tmc.h   |   4 +-
 include/linux/coresight.h                     |  23 ++
 12 files changed, 227 insertions(+), 310 deletions(-)
Signature · 7 lines
2.28.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel