Skip to content

Commit

Permalink
coresight: cti-sysfs: Mark coresight_cti_reg_store() as __maybe_unused
Browse files Browse the repository at this point in the history
When building without CONFIG_CORESIGHT_CTI_INTEGRATION_REGS, there is a
warning about coresight_cti_reg_store() being unused in the file:

  drivers/hwtracing/coresight/coresight-cti-sysfs.c:184:16: warning: 'coresight_cti_reg_store' defined but not used [-Wunused-function]
    184 | static ssize_t coresight_cti_reg_store(struct device *dev,
        |                ^~~~~~~~~~~~~~~~~~~~~~~

This is expected as coresight_cti_reg_store() is only used in the
coresight_cti_reg_rw macro, which is only used in a block guarded by
CONFIG_CORESIGHT_CTI_INTEGRATION_REGS. Mark coresight_cti_reg_store() as
__maybe_unused to clearly indicate that the function may be unused
depending on the configuration.

Fixes: fbca79e ("coresight: cti-sysfs: Re-use same functions for similar sysfs register accessors")
Signed-off-by: Nathan Chancellor <[email protected]>
Reviewed-by: James Clark <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mathieu Poirier <[email protected]>
  • Loading branch information
nathanchance authored and mathieupoirier committed Sep 6, 2022
1 parent 0a98181 commit 269e633
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/hwtracing/coresight/coresight-cti-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ static ssize_t coresight_cti_reg_show(struct device *dev,
}

/* Write registers with power check only (no enable check). */
static ssize_t coresight_cti_reg_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t size)
static __maybe_unused ssize_t coresight_cti_reg_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t size)
{
struct cti_drvdata *drvdata = dev_get_drvdata(dev->parent);
struct cs_off_attribute *cti_attr = container_of(attr, struct cs_off_attribute, attr);
Expand Down

0 comments on commit 269e633

Please sign in to comment.