mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 16:13:19 +09:00
coresight: Use enum type for cs_mode wherever possible
mode is stored as a local_t, but it is also passed around a lot as a plain u32, so use the correct type wherever local_t isn't currently used. This helps a little bit with readability. Reviewed-by: Mike Leach <mike.leach@linaro.org> Signed-off-by: James Clark <james.clark@arm.com> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Link: https://lore.kernel.org/r/20230425143542.2305069-3-james.clark@arm.com
This commit is contained in:
committed by
Suzuki K Poulose
parent
c45b2835e7
commit
9fa3682869
@@ -272,6 +272,12 @@ static struct coresight_dev_list (var) = { \
|
||||
|
||||
#define to_coresight_device(d) container_of(d, struct coresight_device, dev)
|
||||
|
||||
enum cs_mode {
|
||||
CS_MODE_DISABLED,
|
||||
CS_MODE_SYSFS,
|
||||
CS_MODE_PERF,
|
||||
};
|
||||
|
||||
#define source_ops(csdev) csdev->ops->source_ops
|
||||
#define sink_ops(csdev) csdev->ops->sink_ops
|
||||
#define link_ops(csdev) csdev->ops->link_ops
|
||||
@@ -288,7 +294,8 @@ static struct coresight_dev_list (var) = { \
|
||||
* @update_buffer: update buffer pointers after a trace session.
|
||||
*/
|
||||
struct coresight_ops_sink {
|
||||
int (*enable)(struct coresight_device *csdev, u32 mode, void *data);
|
||||
int (*enable)(struct coresight_device *csdev, enum cs_mode mode,
|
||||
void *data);
|
||||
int (*disable)(struct coresight_device *csdev);
|
||||
void *(*alloc_buffer)(struct coresight_device *csdev,
|
||||
struct perf_event *event, void **pages,
|
||||
@@ -320,8 +327,8 @@ struct coresight_ops_link {
|
||||
*/
|
||||
struct coresight_ops_source {
|
||||
int (*cpu_id)(struct coresight_device *csdev);
|
||||
int (*enable)(struct coresight_device *csdev,
|
||||
struct perf_event *event, u32 mode);
|
||||
int (*enable)(struct coresight_device *csdev, struct perf_event *event,
|
||||
enum cs_mode mode);
|
||||
void (*disable)(struct coresight_device *csdev,
|
||||
struct perf_event *event);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user