]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
misc: tegra-profiler: fix defined unused warning
authorPhilip Rakity <prakity@nvidia.com>
Fri, 27 Sep 2013 10:36:47 +0000 (11:36 +0100)
committerAjay Nandakumar <anandakumarm@nvidia.com>
Thu, 3 Oct 2013 13:47:53 +0000 (19:17 +0530)
/nvidia/DEV_KERNEL/kernel/drivers/misc/tegra-profiler/pl310.c:267:44:
warning: 'l2x0_int' defined but not used [-Wunused-variable]

totally ifdef out pl310.c if CONFIG_CACHE_L2X0 is not
defined.

modify main.c to use call the init_event code if the
CONFIG is defined otherwise handle like the module is not there.

Change-Id: I1d050638c46af6af3b8411c1aa299c9a60b41866
Signed-off-by: Philip Rakity <prakity@nvidia.com>
Reviewed-on: http://git-master/r/279787
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
(cherry picked from commit 4ee42249ae580d9eee9b7a28bd4eda553d566fc1)
Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>
drivers/misc/tegra-profiler/main.c
drivers/misc/tegra-profiler/pl310.c

index 823fa4db82cc9a73da10c89c9c7c04c241107aa8..46dd89e00ce0997025bac3ddb4c33dd9108d2d5b 100644 (file)
@@ -407,7 +407,11 @@ static int __init quadd_module_init(void)
                                quadd_get_event_str(events[i]));
        }
 
+#ifdef CONFIG_CACHE_L2X0
        ctx.pl310 = quadd_l2x0_events_init();
+#else
+       ctx.pl310 = NULL;
+#endif
        if (ctx.pl310) {
                events = ctx.pl310_info.supported_events;
                nr_events = ctx.pl310->get_supported_events(events);
index fe5b4937336d97165d34c09e835313308af11f3a..fc82f4b348b08442f4290819e1bfaefcbf6ae886 100644 (file)
@@ -14,6 +14,7 @@
  *
  */
 
+#ifdef CONFIG_CACHE_L2X0
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include <linux/module.h>
@@ -137,16 +138,16 @@ static void l2x0_clear_values(void)
                per_cpu(pl310_prev_val, cpu_id) = 0;
 }
 
-static int l2x0_events_enable(void)
+static int __maybe_unused l2x0_events_enable(void)
 {
        return 0;
 }
 
-static void l2x0_events_disable(void)
+static void __maybe_unused l2x0_events_disable(void)
 {
 }
 
-static void l2x0_events_start(void)
+static void __maybe_unused l2x0_events_start(void)
 {
        unsigned long flags;
 
@@ -161,7 +162,7 @@ static void l2x0_events_start(void)
        qm_debug_start_source(QUADD_EVENT_SOURCE_PL310);
 }
 
-static void l2x0_events_stop(void)
+static void __maybe_unused l2x0_events_stop(void)
 {
        unsigned long flags;
 
@@ -222,7 +223,7 @@ static int __maybe_unused l2x0_events_read_emulate(struct event_data *events)
        return 1;
 }
 
-static int l2x0_set_events(int *events, int size)
+static int __maybe_unused l2x0_set_events(int *events, int size)
 {
        if (!events || size == 0) {
                l2x0_ctx.l2x0_event_type = -1;
@@ -256,7 +257,7 @@ static int l2x0_set_events(int *events, int size)
        return 0;
 }
 
-static int get_supported_events(int *events)
+static int __maybe_unused get_supported_events(int *events)
 {
        events[0] = QUADD_EVENT_TYPE_L2_DCACHE_READ_MISSES;
        events[1] = QUADD_EVENT_TYPE_L2_DCACHE_WRITE_MISSES;
@@ -282,7 +283,6 @@ static struct quadd_event_source_interface l2x0_int = {
 
 struct quadd_event_source_interface *quadd_l2x0_events_init(void)
 {
-#ifdef CONFIG_CACHE_L2X0
        void __iomem *base;
        unsigned long phys_addr;
 
@@ -315,7 +315,6 @@ struct quadd_event_source_interface *quadd_l2x0_events_init(void)
 
        pr_debug("pl310 init success, l2x0_base: %p\n", base);
        return &l2x0_int;
-#else /* CONFIG_CACHE_L2X0 */
        return NULL;
-#endif /* CONFIG_CACHE_L2X0 */
 }
+#endif /* CONFIG_CACHE_L2X0 */