[PATCH] leon,ambapp_bus: make unreferenced global function static

Daniel Hellstrom daniel at gaisler.com
Fri Aug 25 11:51:26 UTC 2017


Fixes #3072
---
 c/src/lib/libbsp/sparc/shared/drvmgr/ambapp_bus.c  | 68 ++++++++++++++--------
 .../libbsp/sparc/shared/drvmgr/ambapp_bus_grlib.c  | 52 ++++++++---------
 2 files changed, 69 insertions(+), 51 deletions(-)

diff --git a/c/src/lib/libbsp/sparc/shared/drvmgr/ambapp_bus.c b/c/src/lib/libbsp/sparc/shared/drvmgr/ambapp_bus.c
index e10633b..3787660 100644
--- a/c/src/lib/libbsp/sparc/shared/drvmgr/ambapp_bus.c
+++ b/c/src/lib/libbsp/sparc/shared/drvmgr/ambapp_bus.c
@@ -40,29 +40,45 @@ struct grlib_gptimer_regs {
 
 /* AMBA IMPLEMENTATION */
 
-int ambapp_bus_init1(struct drvmgr_bus *bus);
-int ambapp_bus_remove(struct drvmgr_bus *bus);
-int ambapp_unite(struct drvmgr_drv *drv, struct drvmgr_dev *dev);
-int ambapp_int_register(struct drvmgr_dev *dev, int index, const char *info, drvmgr_isr isr, void *arg);
-int ambapp_int_unregister(struct drvmgr_dev *dev, int index, drvmgr_isr isr, void *arg);
-int ambapp_int_clear(struct drvmgr_dev *dev, int index);
-int ambapp_int_mask(struct drvmgr_dev *dev, int index);
-int ambapp_int_unmask(struct drvmgr_dev *dev, int index);
-int ambapp_get_params(struct drvmgr_dev *dev, struct drvmgr_bus_params *params);
-int ambapp_bus_freq_get(
+static int ambapp_bus_init1(struct drvmgr_bus *bus);
+static int ambapp_bus_remove(struct drvmgr_bus *bus);
+static int ambapp_unite(struct drvmgr_drv *drv, struct drvmgr_dev *dev);
+static int ambapp_int_register(
+	struct drvmgr_dev *dev,
+	int index,
+	const char *info,
+	drvmgr_isr isr,
+	void *arg);
+static int ambapp_int_unregister(
+	struct drvmgr_dev *dev,
+	int index,
+	drvmgr_isr isr,
+	void *arg);
+static int ambapp_int_clear(struct drvmgr_dev *dev, int index);
+static int ambapp_int_mask(struct drvmgr_dev *dev, int index);
+static int ambapp_int_unmask(struct drvmgr_dev *dev, int index);
+static int ambapp_get_params(
+	struct drvmgr_dev *dev,
+	struct drvmgr_bus_params *params);
+static int ambapp_bus_freq_get(
 	struct drvmgr_dev *dev,
 	int options,
 	unsigned int *freq_hz);
-void ambapp_dev_info(struct drvmgr_dev *, void (*print)(void *p, char *str), void *p);
+#ifdef AMBAPPBUS_INFO_AVAIL
+static void ambapp_dev_info(
+	struct drvmgr_dev *,
+	void (*print)(void *p, char *str),
+	void *p);
+#endif
 
 #ifdef RTEMS_SMP
-int ambapp_int_set_affinity(
+static int ambapp_int_set_affinity(
 	struct drvmgr_dev *dev,
 	int index,
 	const Processor_mask *cpus);
 #endif
 
-struct drvmgr_bus_ops ambapp_bus_ops =
+static struct drvmgr_bus_ops ambapp_bus_ops =
 {
 	.init		= 
 	{
@@ -92,7 +108,7 @@ struct ambapp_priv {
 	struct ambapp_config		*config;
 };
 
-int ambapp_unite(struct drvmgr_drv *drv, struct drvmgr_dev *dev)
+static int ambapp_unite(struct drvmgr_drv *drv, struct drvmgr_dev *dev)
 {
 	struct amba_drv_info *adrv;
 	struct amba_dev_id *id;
@@ -149,7 +165,7 @@ static int ambapp_int_get(struct drvmgr_dev *dev, int index)
 	return irq;
 }
 
-int ambapp_int_register(
+static int ambapp_int_register(
 	struct drvmgr_dev *dev,
 	int index,
 	const char *info,
@@ -177,7 +193,7 @@ int ambapp_int_register(
 	}
 }
 
-int ambapp_int_unregister(
+static int ambapp_int_unregister(
 	struct drvmgr_dev *dev,
 	int index,
 	drvmgr_isr isr,
@@ -204,7 +220,7 @@ int ambapp_int_unregister(
 	}
 }
 
-int ambapp_int_clear(
+static int ambapp_int_clear(
 	struct drvmgr_dev *dev,
 	int index)
 {
@@ -229,7 +245,7 @@ int ambapp_int_clear(
 	}
 }
 
-int ambapp_int_mask(
+static int ambapp_int_mask(
 	struct drvmgr_dev *dev,
 	int index)
 {
@@ -254,7 +270,7 @@ int ambapp_int_mask(
 	}
 }
 
-int ambapp_int_unmask(
+static int ambapp_int_unmask(
 	struct drvmgr_dev *dev,
 	int index)
 {
@@ -315,7 +331,7 @@ void ambapp_bus_freq_register(
 	ambapp_freq_init(priv->config->abus, adev, freq_hz);
 }
 
-int ambapp_bus_freq_get(
+static int ambapp_bus_freq_get(
 	struct drvmgr_dev *dev,
 	int options,
 	unsigned int *freq_hz)
@@ -348,7 +364,9 @@ int ambapp_bus_freq_get(
 	return 0;
 }
 
-int ambapp_get_params(struct drvmgr_dev *dev, struct drvmgr_bus_params *params)
+static int ambapp_get_params(
+	struct drvmgr_dev *dev,
+	struct drvmgr_bus_params *params)
 {
 	struct ambapp_priv *priv = dev->parent->priv;
 
@@ -361,7 +379,7 @@ int ambapp_get_params(struct drvmgr_dev *dev, struct drvmgr_bus_params *params)
 }
 
 #ifdef AMBAPPBUS_INFO_AVAIL
-void ambapp_dev_info(
+static void ambapp_dev_info(
 	struct drvmgr_dev *dev,
 	void (*print_line)(void *p, char *str),
 	void *p)
@@ -782,19 +800,19 @@ int ambapp_bus_register(struct drvmgr_dev *dev, struct ambapp_config *config)
 /*** BUS INITIALIZE FUNCTIONS ***/
 
 /* Initialize the bus, register devices on this bus */
-int ambapp_bus_init1(struct drvmgr_bus *bus)
+static int ambapp_bus_init1(struct drvmgr_bus *bus)
 {
 	/* Initialize the bus, register devices on this bus */
 	return ambapp_ids_register(bus);
 }
 
-int ambapp_bus_remove(struct drvmgr_bus *bus)
+static int ambapp_bus_remove(struct drvmgr_bus *bus)
 {
 	return DRVMGR_OK;
 }
 
 #ifdef RTEMS_SMP
-int ambapp_int_set_affinity(
+static int ambapp_int_set_affinity(
 	struct drvmgr_dev *dev,
 	int index,
 	const Processor_mask *cpus)
diff --git a/c/src/lib/libbsp/sparc/shared/drvmgr/ambapp_bus_grlib.c b/c/src/lib/libbsp/sparc/shared/drvmgr/ambapp_bus_grlib.c
index e299b10..73fd465 100644
--- a/c/src/lib/libbsp/sparc/shared/drvmgr/ambapp_bus_grlib.c
+++ b/c/src/lib/libbsp/sparc/shared/drvmgr/ambapp_bus_grlib.c
@@ -27,44 +27,44 @@
 #define DBG(args...)
 /*#define DBG(args...) printk(args)*/
 
-int ambapp_grlib_int_register(
+static int ambapp_grlib_int_register(
 	struct drvmgr_dev *dev,
 	int irq,
 	const char *info,
 	drvmgr_isr isr,
 	void *arg);
-int ambapp_grlib_int_unregister(
+static int ambapp_grlib_int_unregister(
 	struct drvmgr_dev *dev,
 	int irq,
 	drvmgr_isr isr,
 	void *arg);
-int ambapp_grlib_int_clear(
+static int ambapp_grlib_int_clear(
 	struct drvmgr_dev *dev,
 	int irq);
-int ambapp_grlib_int_mask(
+static int ambapp_grlib_int_mask(
 	struct drvmgr_dev *dev,
 	int irq);
-int ambapp_grlib_int_unmask(
+static int ambapp_grlib_int_unmask(
 	struct drvmgr_dev *dev,
 	int irq);
 #ifdef RTEMS_SMP
-int ambapp_grlib_int_set_affinity(
+static int ambapp_grlib_int_set_affinity(
 	struct drvmgr_dev *dev,
 	int irq,
 	const Processor_mask *cpus);
 #endif
-int ambapp_grlib_get_params(
+static int ambapp_grlib_get_params(
 	struct drvmgr_dev *dev,
 	struct drvmgr_bus_params *params);
 
-int ambapp_grlib_init1(struct drvmgr_dev *dev);
-int ambapp_grlib_init2(struct drvmgr_dev *dev);
-int ambapp_grlib_remove(struct drvmgr_dev *dev);
+static int ambapp_grlib_init1(struct drvmgr_dev *dev);
+static int ambapp_grlib_init2(struct drvmgr_dev *dev);
+static int ambapp_grlib_remove(struct drvmgr_dev *dev);
 
 /* READ/WRITE access to SpaceWire target over RMAP */
-void *ambapp_grlib_rw_arg(struct drvmgr_dev *dev);
+static void *ambapp_grlib_rw_arg(struct drvmgr_dev *dev);
 
-struct ambapp_ops ambapp_grlib_ops = {
+static struct ambapp_ops ambapp_grlib_ops = {
 	.int_register = ambapp_grlib_int_register,
 	.int_unregister = ambapp_grlib_int_unregister,
 	.int_clear = ambapp_grlib_int_clear,
@@ -76,12 +76,12 @@ struct ambapp_ops ambapp_grlib_ops = {
 	.get_params = ambapp_grlib_get_params
 };
 
-void *ambapp_grlib_rw_arg(struct drvmgr_dev *dev)
+static void *ambapp_grlib_rw_arg(struct drvmgr_dev *dev)
 {
 	return dev; /* No argument really needed, but for debug? */
 }
 
-struct drvmgr_func ambapp_grlib_funcs[] =
+static struct drvmgr_func ambapp_grlib_funcs[] =
 {
 	DRVMGR_FUNC(AMBAPP_RW_ARG, ambapp_grlib_rw_arg),
 
@@ -101,14 +101,14 @@ struct drvmgr_func ambapp_grlib_funcs[] =
 	DRVMGR_FUNC_END,
 };
 
-struct drvmgr_drv_ops ambapp_grlib_drv_ops = 
+static struct drvmgr_drv_ops ambapp_grlib_drv_ops = 
 {
 	.init = {ambapp_grlib_init1, ambapp_grlib_init2, NULL, NULL},
 	.remove = ambapp_grlib_remove,
 	.info = NULL,
 };
 
-struct drvmgr_drv ambapp_bus_drv_grlib = 
+static struct drvmgr_drv ambapp_bus_drv_grlib = 
 {
 	DRVMGR_OBJ_DRV,			/* Driver */
 	NULL,				/* Next driver */
@@ -142,7 +142,7 @@ int ambapp_grlib_root_register(struct grlib_config *config)
 }
 
 /* Function called from Driver Manager Initialization Stage 1 */
-int ambapp_grlib_init1(struct drvmgr_dev *dev)
+static int ambapp_grlib_init1(struct drvmgr_dev *dev)
 {
 	struct ambapp_config *config;
 
@@ -167,17 +167,17 @@ int ambapp_grlib_init1(struct drvmgr_dev *dev)
 	return ambapp_bus_register(dev, config);
 }
 
-int ambapp_grlib_init2(struct drvmgr_dev *dev)
+static int ambapp_grlib_init2(struct drvmgr_dev *dev)
 {
 	return 0;
 }
 
-int ambapp_grlib_remove(struct drvmgr_dev *dev)
+static int ambapp_grlib_remove(struct drvmgr_dev *dev)
 {
 	return 0;
 }
 
-int ambapp_grlib_int_register
+static int ambapp_grlib_int_register
 	(
 	struct drvmgr_dev *dev,
 	int irq,
@@ -189,7 +189,7 @@ int ambapp_grlib_int_register
 	return BSP_shared_interrupt_register(irq, info, isr, arg);
 }
 
-int ambapp_grlib_int_unregister
+static int ambapp_grlib_int_unregister
 	(
 	struct drvmgr_dev *dev,
 	int irq,
@@ -200,7 +200,7 @@ int ambapp_grlib_int_unregister
 	return BSP_shared_interrupt_unregister(irq, isr, arg);
 }
 
-int ambapp_grlib_int_clear
+static int ambapp_grlib_int_clear
 	(
 	struct drvmgr_dev *dev,
 	int irq)
@@ -209,7 +209,7 @@ int ambapp_grlib_int_clear
 	return DRVMGR_OK;
 }
 
-int ambapp_grlib_int_mask
+static int ambapp_grlib_int_mask
 	(
 	struct drvmgr_dev *dev,
 	int irq
@@ -219,7 +219,7 @@ int ambapp_grlib_int_mask
 	return DRVMGR_OK;
 }
 
-int ambapp_grlib_int_unmask
+static int ambapp_grlib_int_unmask
 	(
 	struct drvmgr_dev *dev,
 	int irq
@@ -230,7 +230,7 @@ int ambapp_grlib_int_unmask
 }
 
 #ifdef RTEMS_SMP
-int ambapp_grlib_int_set_affinity
+static int ambapp_grlib_int_set_affinity
 	(
 	struct drvmgr_dev *dev,
 	int irq,
@@ -242,7 +242,7 @@ int ambapp_grlib_int_set_affinity
 }
 #endif
 
-int ambapp_grlib_get_params(struct drvmgr_dev *dev, struct drvmgr_bus_params *params)
+static int ambapp_grlib_get_params(struct drvmgr_dev *dev, struct drvmgr_bus_params *params)
 {
 	/* Leave params->freq_hz untouched for default */
 	params->dev_prefix = "";
-- 
2.7.4




More information about the devel mailing list