* [PATCH] ARM: l2x0: fix build warning without CONFIG_OF
@ 2014-08-01 2:42 Kefeng Wang
2014-08-01 7:58 ` Russell King - ARM Linux
0 siblings, 1 reply; 3+ messages in thread
From: Kefeng Wang @ 2014-08-01 2:42 UTC (permalink / raw)
To: linux-arm-kernel
Commit cf9ea8f13(ARM: l2c: remove obsolete l2x0 ops for non-OF init)
remove some obsolete l2x0 ops, the rest of ops: l2x0_cache_sync,
l2x0_cache_sync, l2x0_disable only use under OF enable, so move them
into OF part, or "defined but not used" warning occurs.
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
arch/arm/mm/cache-l2x0.c | 134 +++++++++++++++++++++++------------------------
1 file changed, 67 insertions(+), 67 deletions(-)
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 7c3fb41..77e57b0 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -135,73 +135,6 @@ static void l2c_disable(void)
dsb(st);
}
-#ifdef CONFIG_CACHE_PL310
-static inline void cache_wait(void __iomem *reg, unsigned long mask)
-{
- /* cache operations by line are atomic on PL310 */
-}
-#else
-#define cache_wait l2c_wait_mask
-#endif
-
-static inline void cache_sync(void)
-{
- void __iomem *base = l2x0_base;
-
- writel_relaxed(0, base + sync_reg_offset);
- cache_wait(base + L2X0_CACHE_SYNC, 1);
-}
-
-#if defined(CONFIG_PL310_ERRATA_588369) || defined(CONFIG_PL310_ERRATA_727915)
-static inline void debug_writel(unsigned long val)
-{
- l2c_set_debug(l2x0_base, val);
-}
-#else
-/* Optimised out for non-errata case */
-static inline void debug_writel(unsigned long val)
-{
-}
-#endif
-
-static void l2x0_cache_sync(void)
-{
- unsigned long flags;
-
- raw_spin_lock_irqsave(&l2x0_lock, flags);
- cache_sync();
- raw_spin_unlock_irqrestore(&l2x0_lock, flags);
-}
-
-static void __l2x0_flush_all(void)
-{
- debug_writel(0x03);
- __l2c_op_way(l2x0_base + L2X0_CLEAN_INV_WAY);
- cache_sync();
- debug_writel(0x00);
-}
-
-static void l2x0_flush_all(void)
-{
- unsigned long flags;
-
- /* clean all ways */
- raw_spin_lock_irqsave(&l2x0_lock, flags);
- __l2x0_flush_all();
- raw_spin_unlock_irqrestore(&l2x0_lock, flags);
-}
-
-static void l2x0_disable(void)
-{
- unsigned long flags;
-
- raw_spin_lock_irqsave(&l2x0_lock, flags);
- __l2x0_flush_all();
- l2c_write_sec(0, l2x0_base, L2X0_CTRL);
- dsb(st);
- raw_spin_unlock_irqrestore(&l2x0_lock, flags);
-}
-
static void l2c_save(void __iomem *base)
{
l2x0_saved_regs.aux_ctrl = readl_relaxed(l2x0_base + L2X0_AUX_CTRL);
@@ -945,6 +878,73 @@ static int l2_wt_override;
* pass it though the device tree */
static u32 cache_id_part_number_from_dt;
+#ifdef CONFIG_CACHE_PL310
+static inline void cache_wait(void __iomem *reg, unsigned long mask)
+{
+ /* cache operations by line are atomic on PL310 */
+}
+#else
+#define cache_wait l2c_wait_mask
+#endif
+
+static inline void cache_sync(void)
+{
+ void __iomem *base = l2x0_base;
+
+ writel_relaxed(0, base + sync_reg_offset);
+ cache_wait(base + L2X0_CACHE_SYNC, 1);
+}
+
+#if defined(CONFIG_PL310_ERRATA_588369) || defined(CONFIG_PL310_ERRATA_727915)
+static inline void debug_writel(unsigned long val)
+{
+ l2c_set_debug(l2x0_base, val);
+}
+#else
+/* Optimised out for non-errata case */
+static inline void debug_writel(unsigned long val)
+{
+}
+#endif
+
+static void l2x0_cache_sync(void)
+{
+ unsigned long flags;
+
+ raw_spin_lock_irqsave(&l2x0_lock, flags);
+ cache_sync();
+ raw_spin_unlock_irqrestore(&l2x0_lock, flags);
+}
+
+static void __l2x0_flush_all(void)
+{
+ debug_writel(0x03);
+ __l2c_op_way(l2x0_base + L2X0_CLEAN_INV_WAY);
+ cache_sync();
+ debug_writel(0x00);
+}
+
+static void l2x0_flush_all(void)
+{
+ unsigned long flags;
+
+ /* clean all ways */
+ raw_spin_lock_irqsave(&l2x0_lock, flags);
+ __l2x0_flush_all();
+ raw_spin_unlock_irqrestore(&l2x0_lock, flags);
+}
+
+static void l2x0_disable(void)
+{
+ unsigned long flags;
+
+ raw_spin_lock_irqsave(&l2x0_lock, flags);
+ __l2x0_flush_all();
+ l2c_write_sec(0, l2x0_base, L2X0_CTRL);
+ dsb(st);
+ raw_spin_unlock_irqrestore(&l2x0_lock, flags);
+}
+
static void __init l2x0_of_parse(const struct device_node *np,
u32 *aux_val, u32 *aux_mask)
{
--
1.7.12.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH] ARM: l2x0: fix build warning without CONFIG_OF
2014-08-01 2:42 [PATCH] ARM: l2x0: fix build warning without CONFIG_OF Kefeng Wang
@ 2014-08-01 7:58 ` Russell King - ARM Linux
2014-08-01 8:57 ` Kefeng Wang
0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux @ 2014-08-01 7:58 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Aug 01, 2014 at 10:42:00AM +0800, Kefeng Wang wrote:
> Commit cf9ea8f13(ARM: l2c: remove obsolete l2x0 ops for non-OF init)
> remove some obsolete l2x0 ops, the rest of ops: l2x0_cache_sync,
> l2x0_cache_sync, l2x0_disable only use under OF enable, so move them
> into OF part, or "defined but not used" warning occurs.
I'm not interested; I've stated previously that I want these warnings
to stay until such time that the code which uses them is fixed up to
use the new methods.
The warnings act as an advertisment that it needs fixing properly.
--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] ARM: l2x0: fix build warning without CONFIG_OF
2014-08-01 7:58 ` Russell King - ARM Linux
@ 2014-08-01 8:57 ` Kefeng Wang
0 siblings, 0 replies; 3+ messages in thread
From: Kefeng Wang @ 2014-08-01 8:57 UTC (permalink / raw)
To: linux-arm-kernel
On 08/01 15:58, Russell King - ARM Linux wrote:
> On Fri, Aug 01, 2014 at 10:42:00AM +0800, Kefeng Wang wrote:
>> Commit cf9ea8f13(ARM: l2c: remove obsolete l2x0 ops for non-OF init)
>> remove some obsolete l2x0 ops, the rest of ops: l2x0_cache_sync,
>> l2x0_cache_sync, l2x0_disable only use under OF enable, so move them
>> into OF part, or "defined but not used" warning occurs.
>
> I'm not interested; I've stated previously that I want these warnings
> to stay until such time that the code which uses them is fixed up to
> use the new methods.
>
> The warnings act as an advertisment that it needs fixing properly.
>
Ok, ignore pls.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-08-01 8:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-01 2:42 [PATCH] ARM: l2x0: fix build warning without CONFIG_OF Kefeng Wang
2014-08-01 7:58 ` Russell King - ARM Linux
2014-08-01 8:57 ` Kefeng Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).