Skip to content

Commit 48a5126

Browse files
james-c-linaroSuzuki K Poulose
authored andcommitted
coresight: Remove inlines from static function definitions
These are all static and in one compilation unit so the inline has no effect on the binary. Except if FTRACE is enabled, then some functions which were already not inlined now get the nops added which allows them to be traced. Reviewed-by: Leo Yan <[email protected]> Reviewed-by: Yeoreum Yun <[email protected]> Signed-off-by: James Clark <[email protected]> Signed-off-by: Suzuki K Poulose <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 7cd6368 commit 48a5126

12 files changed

+57
-60
lines changed

drivers/hwtracing/coresight/coresight-catu.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,8 @@ typedef u64 cate_t;
113113
* containing the data page pointer for @offset. If @daddrp is not NULL,
114114
* @daddrp points the DMA address of the beginning of the table.
115115
*/
116-
static inline cate_t *catu_get_table(struct tmc_sg_table *catu_table,
117-
unsigned long offset,
118-
dma_addr_t *daddrp)
116+
static cate_t *catu_get_table(struct tmc_sg_table *catu_table, unsigned long offset,
117+
dma_addr_t *daddrp)
119118
{
120119
unsigned long buf_size = tmc_sg_table_buf_size(catu_table);
121120
unsigned int table_nr, pg_idx, pg_offset;
@@ -165,12 +164,12 @@ static void catu_dump_table(struct tmc_sg_table *catu_table)
165164
}
166165

167166
#else
168-
static inline void catu_dump_table(struct tmc_sg_table *catu_table)
167+
static void catu_dump_table(struct tmc_sg_table *catu_table)
169168
{
170169
}
171170
#endif
172171

173-
static inline cate_t catu_make_entry(dma_addr_t addr)
172+
static cate_t catu_make_entry(dma_addr_t addr)
174173
{
175174
return addr ? CATU_VALID_ENTRY(addr) : 0;
176175
}
@@ -390,7 +389,7 @@ static const struct attribute_group *catu_groups[] = {
390389
};
391390

392391

393-
static inline int catu_wait_for_ready(struct catu_drvdata *drvdata)
392+
static int catu_wait_for_ready(struct catu_drvdata *drvdata)
394393
{
395394
struct csdev_access *csa = &drvdata->csdev->access;
396395

drivers/hwtracing/coresight/coresight-core.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,13 @@ coresight_find_out_connection(struct coresight_device *csdev,
129129
return ERR_PTR(-ENODEV);
130130
}
131131

132-
static inline u32 coresight_read_claim_tags_unlocked(struct coresight_device *csdev)
132+
static u32 coresight_read_claim_tags_unlocked(struct coresight_device *csdev)
133133
{
134134
return FIELD_GET(CORESIGHT_CLAIM_MASK,
135135
csdev_access_relaxed_read32(&csdev->access, CORESIGHT_CLAIMCLR));
136136
}
137137

138-
static inline void coresight_set_self_claim_tag_unlocked(struct coresight_device *csdev)
138+
static void coresight_set_self_claim_tag_unlocked(struct coresight_device *csdev)
139139
{
140140
csdev_access_relaxed_write32(&csdev->access, CORESIGHT_CLAIM_SELF_HOSTED,
141141
CORESIGHT_CLAIMSET);
@@ -609,7 +609,7 @@ struct coresight_device *coresight_get_sink_by_id(u32 id)
609609
* Return true in successful case and power up the device.
610610
* Return false when failed to get reference of module.
611611
*/
612-
static inline bool coresight_get_ref(struct coresight_device *csdev)
612+
static bool coresight_get_ref(struct coresight_device *csdev)
613613
{
614614
struct device *dev = csdev->dev.parent;
615615

@@ -628,7 +628,7 @@ static inline bool coresight_get_ref(struct coresight_device *csdev)
628628
*
629629
* @csdev: The coresight device to decrement a reference from.
630630
*/
631-
static inline void coresight_put_ref(struct coresight_device *csdev)
631+
static void coresight_put_ref(struct coresight_device *csdev)
632632
{
633633
struct device *dev = csdev->dev.parent;
634634

@@ -851,7 +851,7 @@ void coresight_release_path(struct coresight_path *path)
851851
}
852852

853853
/* return true if the device is a suitable type for a default sink */
854-
static inline bool coresight_is_def_sink_type(struct coresight_device *csdev)
854+
static bool coresight_is_def_sink_type(struct coresight_device *csdev)
855855
{
856856
/* sink & correct subtype */
857857
if (((csdev->type == CORESIGHT_DEV_TYPE_SINK) ||
@@ -1415,8 +1415,8 @@ EXPORT_SYMBOL_GPL(coresight_unregister);
14151415
*
14161416
* Returns the index of the entry, when found. Otherwise, -ENOENT.
14171417
*/
1418-
static inline int coresight_search_device_idx(struct coresight_dev_list *dict,
1419-
struct fwnode_handle *fwnode)
1418+
static int coresight_search_device_idx(struct coresight_dev_list *dict,
1419+
struct fwnode_handle *fwnode)
14201420
{
14211421
int i;
14221422

drivers/hwtracing/coresight/coresight-etb10.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ struct etb_drvdata {
9595
static int etb_set_buffer(struct coresight_device *csdev,
9696
struct perf_output_handle *handle);
9797

98-
static inline unsigned int etb_get_buffer_depth(struct etb_drvdata *drvdata)
98+
static unsigned int etb_get_buffer_depth(struct etb_drvdata *drvdata)
9999
{
100100
return readl_relaxed(drvdata->base + ETB_RAM_DEPTH_REG);
101101
}

drivers/hwtracing/coresight/coresight-etm4x-core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static int etm4_probe_cpu(unsigned int cpu);
8484
* TRCIDR4.NUMPC > 0b0000 .
8585
* TRCSSCSR<n>.PC == 0b1
8686
*/
87-
static inline bool etm4x_sspcicrn_present(struct etmv4_drvdata *drvdata, int n)
87+
static bool etm4x_sspcicrn_present(struct etmv4_drvdata *drvdata, int n)
8888
{
8989
return (n < drvdata->nr_ss_cmp) &&
9090
drvdata->nr_pe &&
@@ -185,7 +185,7 @@ static void etm_write_os_lock(struct etmv4_drvdata *drvdata,
185185
isb();
186186
}
187187

188-
static inline void etm4_os_unlock_csa(struct etmv4_drvdata *drvdata,
188+
static void etm4_os_unlock_csa(struct etmv4_drvdata *drvdata,
189189
struct csdev_access *csa)
190190
{
191191
WARN_ON(drvdata->cpu != smp_processor_id());
@@ -1070,7 +1070,7 @@ static const struct coresight_ops etm4_cs_ops = {
10701070
.source_ops = &etm4_source_ops,
10711071
};
10721072

1073-
static inline bool cpu_supports_sysreg_trace(void)
1073+
static bool cpu_supports_sysreg_trace(void)
10741074
{
10751075
u64 dfr0 = read_sysreg_s(SYS_ID_AA64DFR0_EL1);
10761076

@@ -1378,7 +1378,7 @@ static void etm4_init_arch_data(void *info)
13781378
cpu_detect_trace_filtering(drvdata);
13791379
}
13801380

1381-
static inline u32 etm4_get_victlr_access_type(struct etmv4_config *config)
1381+
static u32 etm4_get_victlr_access_type(struct etmv4_config *config)
13821382
{
13831383
return etm4_get_access_type(config) << __bf_shf(TRCVICTLR_EXLEVEL_MASK);
13841384
}

drivers/hwtracing/coresight/coresight-etm4x-sysfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2440,7 +2440,7 @@ static u32 etmv4_cross_read(const struct etmv4_drvdata *drvdata, u32 offset)
24402440
return reg.data;
24412441
}
24422442

2443-
static inline u32 coresight_etm4x_attr_to_offset(struct device_attribute *attr)
2443+
static u32 coresight_etm4x_attr_to_offset(struct device_attribute *attr)
24442444
{
24452445
struct dev_ext_attribute *eattr;
24462446

@@ -2464,7 +2464,7 @@ static ssize_t coresight_etm4x_reg_show(struct device *dev,
24642464
return scnprintf(buf, PAGE_SIZE, "0x%x\n", val);
24652465
}
24662466

2467-
static inline bool
2467+
static bool
24682468
etm4x_register_implemented(struct etmv4_drvdata *drvdata, u32 offset)
24692469
{
24702470
switch (offset) {

drivers/hwtracing/coresight/coresight-platform.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ coresight_find_csdev_by_fwnode(struct fwnode_handle *r_fwnode)
139139
EXPORT_SYMBOL_GPL(coresight_find_csdev_by_fwnode);
140140

141141
#ifdef CONFIG_OF
142-
static inline bool of_coresight_legacy_ep_is_input(struct device_node *ep)
142+
static bool of_coresight_legacy_ep_is_input(struct device_node *ep)
143143
{
144144
return of_property_read_bool(ep, "slave-mode");
145145
}
@@ -159,7 +159,7 @@ static struct device_node *of_coresight_get_port_parent(struct device_node *ep)
159159
return parent;
160160
}
161161

162-
static inline struct device_node *
162+
static struct device_node *
163163
of_coresight_get_output_ports_node(const struct device_node *node)
164164
{
165165
return of_get_child_by_name(node, "out-ports");
@@ -327,14 +327,14 @@ static int of_get_coresight_platform_data(struct device *dev,
327327
return 0;
328328
}
329329
#else
330-
static inline int
330+
static int
331331
of_get_coresight_platform_data(struct device *dev,
332332
struct coresight_platform_data *pdata)
333333
{
334334
return -ENOENT;
335335
}
336336

337-
static inline int of_coresight_get_cpu(struct device *dev)
337+
static int of_coresight_get_cpu(struct device *dev)
338338
{
339339
return -ENODEV;
340340
}
@@ -356,7 +356,7 @@ static const guid_t coresight_graph_uuid = GUID_INIT(0x3ecbc8b6, 0x1d0e, 0x4fb3,
356356
#define ACPI_CORESIGHT_LINK_SLAVE 0
357357
#define ACPI_CORESIGHT_LINK_MASTER 1
358358

359-
static inline bool is_acpi_guid(const union acpi_object *obj)
359+
static bool is_acpi_guid(const union acpi_object *obj)
360360
{
361361
return (obj->type == ACPI_TYPE_BUFFER) && (obj->buffer.length == 16);
362362
}
@@ -365,24 +365,24 @@ static inline bool is_acpi_guid(const union acpi_object *obj)
365365
* acpi_guid_matches - Checks if the given object is a GUID object and
366366
* that it matches the supplied the GUID.
367367
*/
368-
static inline bool acpi_guid_matches(const union acpi_object *obj,
368+
static bool acpi_guid_matches(const union acpi_object *obj,
369369
const guid_t *guid)
370370
{
371371
return is_acpi_guid(obj) &&
372372
guid_equal((guid_t *)obj->buffer.pointer, guid);
373373
}
374374

375-
static inline bool is_acpi_dsd_graph_guid(const union acpi_object *obj)
375+
static bool is_acpi_dsd_graph_guid(const union acpi_object *obj)
376376
{
377377
return acpi_guid_matches(obj, &acpi_graph_uuid);
378378
}
379379

380-
static inline bool is_acpi_coresight_graph_guid(const union acpi_object *obj)
380+
static bool is_acpi_coresight_graph_guid(const union acpi_object *obj)
381381
{
382382
return acpi_guid_matches(obj, &coresight_graph_uuid);
383383
}
384384

385-
static inline bool is_acpi_coresight_graph(const union acpi_object *obj)
385+
static bool is_acpi_coresight_graph(const union acpi_object *obj)
386386
{
387387
const union acpi_object *graphid, *guid, *links;
388388

@@ -469,7 +469,7 @@ static inline bool is_acpi_coresight_graph(const union acpi_object *obj)
469469
* }, // End of ACPI Graph Property
470470
* })
471471
*/
472-
static inline bool acpi_validate_dsd_graph(const union acpi_object *graph)
472+
static bool acpi_validate_dsd_graph(const union acpi_object *graph)
473473
{
474474
int i, n;
475475
const union acpi_object *rev, *nr_graphs;
@@ -553,7 +553,7 @@ acpi_get_dsd_graph(struct acpi_device *adev, struct acpi_buffer *buf)
553553
return NULL;
554554
}
555555

556-
static inline bool
556+
static bool
557557
acpi_validate_coresight_graph(const union acpi_object *cs_graph)
558558
{
559559
int nlinks;
@@ -794,14 +794,14 @@ acpi_get_coresight_platform_data(struct device *dev,
794794

795795
#else
796796

797-
static inline int
797+
static int
798798
acpi_get_coresight_platform_data(struct device *dev,
799799
struct coresight_platform_data *pdata)
800800
{
801801
return -ENOENT;
802802
}
803803

804-
static inline int acpi_coresight_get_cpu(struct device *dev)
804+
static int acpi_coresight_get_cpu(struct device *dev)
805805
{
806806
return -ENODEV;
807807
}

drivers/hwtracing/coresight/coresight-replicator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static void dynamic_replicator_reset(struct replicator_drvdata *drvdata)
6363
/*
6464
* replicator_reset : Reset the replicator configuration to sane values.
6565
*/
66-
static inline void replicator_reset(struct replicator_drvdata *drvdata)
66+
static void replicator_reset(struct replicator_drvdata *drvdata)
6767
{
6868
if (drvdata->base)
6969
dynamic_replicator_reset(drvdata);

drivers/hwtracing/coresight/coresight-stm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ static const struct coresight_ops stm_cs_ops = {
301301
.source_ops = &stm_source_ops,
302302
};
303303

304-
static inline bool stm_addr_unaligned(const void *addr, u8 write_bytes)
304+
static bool stm_addr_unaligned(const void *addr, u8 write_bytes)
305305
{
306306
return ((unsigned long)addr & (write_bytes - 1));
307307
}
@@ -685,7 +685,7 @@ static int of_stm_get_stimulus_area(struct device *dev, struct resource *res)
685685
return of_address_to_resource(np, index, res);
686686
}
687687
#else
688-
static inline int of_stm_get_stimulus_area(struct device *dev,
688+
static int of_stm_get_stimulus_area(struct device *dev,
689689
struct resource *res)
690690
{
691691
return -ENOENT;
@@ -729,7 +729,7 @@ static int acpi_stm_get_stimulus_area(struct device *dev, struct resource *res)
729729
return rc;
730730
}
731731
#else
732-
static inline int acpi_stm_get_stimulus_area(struct device *dev,
732+
static int acpi_stm_get_stimulus_area(struct device *dev,
733733
struct resource *res)
734734
{
735735
return -ENOENT;

drivers/hwtracing/coresight/coresight-syscfg-configfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include "coresight-syscfg-configfs.h"
1111

1212
/* create a default ci_type. */
13-
static inline struct config_item_type *cscfg_create_ci_type(void)
13+
static struct config_item_type *cscfg_create_ci_type(void)
1414
{
1515
struct config_item_type *ci_type;
1616

drivers/hwtracing/coresight/coresight-tmc-core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,8 @@ static int tmc_open(struct inode *inode, struct file *file)
287287
return 0;
288288
}
289289

290-
static inline ssize_t tmc_get_sysfs_trace(struct tmc_drvdata *drvdata,
291-
loff_t pos, size_t len, char **bufpp)
290+
static ssize_t tmc_get_sysfs_trace(struct tmc_drvdata *drvdata, loff_t pos, size_t len,
291+
char **bufpp)
292292
{
293293
switch (drvdata->config_type) {
294294
case TMC_CONFIG_TYPE_ETB:
@@ -591,7 +591,7 @@ static const struct attribute_group *coresight_etr_groups[] = {
591591
NULL,
592592
};
593593

594-
static inline bool tmc_etr_can_use_sg(struct device *dev)
594+
static bool tmc_etr_can_use_sg(struct device *dev)
595595
{
596596
int ret;
597597
u8 val_u8;
@@ -621,7 +621,7 @@ static inline bool tmc_etr_can_use_sg(struct device *dev)
621621
return false;
622622
}
623623

624-
static inline bool tmc_etr_has_non_secure_access(struct tmc_drvdata *drvdata)
624+
static bool tmc_etr_has_non_secure_access(struct tmc_drvdata *drvdata)
625625
{
626626
u32 auth = readl_relaxed(drvdata->base + TMC_AUTHSTATUS);
627627

0 commit comments

Comments
 (0)