linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] powerpc: trivial unused functions cleanup
@ 2015-02-16 10:56 Arseny Solokha
  2015-02-16 10:56 ` [PATCH 1/4] powerpc/boot: drop planetcore_set_serial_speed Arseny Solokha
                   ` (4 more replies)
  0 siblings, 5 replies; 31+ messages in thread
From: Arseny Solokha @ 2015-02-16 10:56 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Paul Mackerras, Michael Ellerman, Scott Wood, linuxppc-dev,
	linux-kernel, Arseny Solokha

This series removes unused functions from powerpc tree that I've been
able to discover.

Arseny Solokha (4):
  powerpc/boot: drop planetcore_set_serial_speed
  kvm/ppc/mpic: drop unused IRQ_testbit
  powrepc/qe: drop unused ucc_slow_poll_transmitter_now
  powerpc/mpic: remove unused functions

 arch/powerpc/boot/planetcore.c        | 33 ---------------------------------
 arch/powerpc/boot/planetcore.h        |  3 ---
 arch/powerpc/include/asm/mpic.h       | 16 ----------------
 arch/powerpc/include/asm/ucc_slow.h   | 13 -------------
 arch/powerpc/kvm/mpic.c               |  5 -----
 arch/powerpc/sysdev/mpic.c            | 35 -----------------------------------
 arch/powerpc/sysdev/qe_lib/ucc_slow.c |  5 -----
 7 files changed, 110 deletions(-)

-- 
2.3.0


^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 1/4] powerpc/boot: drop planetcore_set_serial_speed
  2015-02-16 10:56 [PATCH 0/4] powerpc: trivial unused functions cleanup Arseny Solokha
@ 2015-02-16 10:56 ` Arseny Solokha
  2015-02-16 10:56 ` [PATCH 2/4] kvm/ppc/mpic: drop unused IRQ_testbit Arseny Solokha
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 31+ messages in thread
From: Arseny Solokha @ 2015-02-16 10:56 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Paul Mackerras, Michael Ellerman, Scott Wood, linuxppc-dev,
	linux-kernel, Arseny Solokha

Drop planetcore_set_serial_speed() which had no users since its inception.

Signed-off-by: Arseny Solokha <asolokha@kb.kras.ru>
---
 arch/powerpc/boot/planetcore.c | 33 ---------------------------------
 arch/powerpc/boot/planetcore.h |  3 ---
 2 files changed, 36 deletions(-)

diff --git a/arch/powerpc/boot/planetcore.c b/arch/powerpc/boot/planetcore.c
index 0d8558a..75117e6 100644
--- a/arch/powerpc/boot/planetcore.c
+++ b/arch/powerpc/boot/planetcore.c
@@ -131,36 +131,3 @@ void planetcore_set_stdout_path(const char *table)
 
 	setprop_str(chosen, "linux,stdout-path", path);
 }
-
-void planetcore_set_serial_speed(const char *table)
-{
-	void *chosen, *stdout;
-	u64 baud;
-	u32 baud32;
-	int len;
-
-	chosen = finddevice("/chosen");
-	if (!chosen)
-		return;
-
-	len = getprop(chosen, "linux,stdout-path", prop_buf, MAX_PROP_LEN);
-	if (len <= 0)
-		return;
-
-	stdout = finddevice(prop_buf);
-	if (!stdout) {
-		printf("planetcore_set_serial_speed: "
-		       "Bad /chosen/linux,stdout-path.\r\n");
-
-		return;
-	}
-
-	if (!planetcore_get_decimal(table, PLANETCORE_KEY_SERIAL_BAUD,
-	                            &baud)) {
-		printf("planetcore_set_serial_speed: No SB tag.\r\n");
-		return;
-	}
-
-	baud32 = baud;
-	setprop(stdout, "current-speed", &baud32, 4);
-}
diff --git a/arch/powerpc/boot/planetcore.h b/arch/powerpc/boot/planetcore.h
index 0d4094f..d53c733 100644
--- a/arch/powerpc/boot/planetcore.h
+++ b/arch/powerpc/boot/planetcore.h
@@ -43,7 +43,4 @@ void planetcore_set_mac_addrs(const char *table);
  */
 void planetcore_set_stdout_path(const char *table);
 
-/* Sets the current-speed property in the serial node. */
-void planetcore_set_serial_speed(const char *table);
-
 #endif
-- 
2.3.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 2/4] kvm/ppc/mpic: drop unused IRQ_testbit
  2015-02-16 10:56 [PATCH 0/4] powerpc: trivial unused functions cleanup Arseny Solokha
  2015-02-16 10:56 ` [PATCH 1/4] powerpc/boot: drop planetcore_set_serial_speed Arseny Solokha
@ 2015-02-16 10:56 ` Arseny Solokha
  2015-02-16 10:56 ` [PATCH 3/4] powrepc/qe: drop unused ucc_slow_poll_transmitter_now Arseny Solokha
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 31+ messages in thread
From: Arseny Solokha @ 2015-02-16 10:56 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Paul Mackerras, Michael Ellerman, Scott Wood, linuxppc-dev,
	linux-kernel, Arseny Solokha, Alexander Graf, Gleb Natapov,
	Paolo Bonzini

Drop unused static procedure which doesn't have callers within its
translation unit.

Signed-off-by: Arseny Solokha <asolokha@kb.kras.ru>
Cc: Alexander Graf <agraf@suse.de>
Cc: Gleb Natapov <gleb@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
---
 arch/powerpc/kvm/mpic.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/arch/powerpc/kvm/mpic.c b/arch/powerpc/kvm/mpic.c
index 39b3a8f..a480d99 100644
--- a/arch/powerpc/kvm/mpic.c
+++ b/arch/powerpc/kvm/mpic.c
@@ -289,11 +289,6 @@ static inline void IRQ_resetbit(struct irq_queue *q, int n_IRQ)
 	clear_bit(n_IRQ, q->queue);
 }
 
-static inline int IRQ_testbit(struct irq_queue *q, int n_IRQ)
-{
-	return test_bit(n_IRQ, q->queue);
-}
-
 static void IRQ_check(struct openpic *opp, struct irq_queue *q)
 {
 	int irq = -1;
-- 
2.3.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3/4] powrepc/qe: drop unused ucc_slow_poll_transmitter_now
  2015-02-16 10:56 [PATCH 0/4] powerpc: trivial unused functions cleanup Arseny Solokha
  2015-02-16 10:56 ` [PATCH 1/4] powerpc/boot: drop planetcore_set_serial_speed Arseny Solokha
  2015-02-16 10:56 ` [PATCH 2/4] kvm/ppc/mpic: drop unused IRQ_testbit Arseny Solokha
@ 2015-02-16 10:56 ` Arseny Solokha
  2015-02-16 10:56 ` [PATCH 4/4] powerpc/mpic: remove unused functions Arseny Solokha
  2015-02-24  9:05 ` [PATCH V2 0/4] powerpc: trivial unused functions cleanup Arseny Solokha
  4 siblings, 0 replies; 31+ messages in thread
From: Arseny Solokha @ 2015-02-16 10:56 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Paul Mackerras, Michael Ellerman, Scott Wood, linuxppc-dev,
	linux-kernel, Arseny Solokha

Drop ucc_slow_poll_transmitter_now() which has no users.

Signed-off-by: Arseny Solokha <asolokha@kb.kras.ru>
---
 arch/powerpc/include/asm/ucc_slow.h   | 13 -------------
 arch/powerpc/sysdev/qe_lib/ucc_slow.c |  5 -----
 2 files changed, 18 deletions(-)

diff --git a/arch/powerpc/include/asm/ucc_slow.h b/arch/powerpc/include/asm/ucc_slow.h
index c44131e..233ef5f 100644
--- a/arch/powerpc/include/asm/ucc_slow.h
+++ b/arch/powerpc/include/asm/ucc_slow.h
@@ -251,19 +251,6 @@ void ucc_slow_enable(struct ucc_slow_private * uccs, enum comm_dir mode);
  */
 void ucc_slow_disable(struct ucc_slow_private * uccs, enum comm_dir mode);
 
-/* ucc_slow_poll_transmitter_now
- * Immediately forces a poll of the transmitter for data to be sent.
- * Typically, the hardware performs a periodic poll for data that the
- * transmit routine has set up to be transmitted. In cases where
- * this polling cycle is not soon enough, this optional routine can
- * be invoked to force a poll right away, instead. Proper use for
- * each transmission for which this functionality is desired is to
- * call the transmit routine and then this routine right after.
- *
- * uccs - (In) pointer to the slow UCC structure.
- */
-void ucc_slow_poll_transmitter_now(struct ucc_slow_private * uccs);
-
 /* ucc_slow_graceful_stop_tx
  * Smoothly stops transmission on a specified slow UCC.
  *
diff --git a/arch/powerpc/sysdev/qe_lib/ucc_slow.c b/arch/powerpc/sysdev/qe_lib/ucc_slow.c
index befaf11..5f91628 100644
--- a/arch/powerpc/sysdev/qe_lib/ucc_slow.c
+++ b/arch/powerpc/sysdev/qe_lib/ucc_slow.c
@@ -43,11 +43,6 @@ u32 ucc_slow_get_qe_cr_subblock(int uccs_num)
 }
 EXPORT_SYMBOL(ucc_slow_get_qe_cr_subblock);
 
-void ucc_slow_poll_transmitter_now(struct ucc_slow_private * uccs)
-{
-	out_be16(&uccs->us_regs->utodr, UCC_SLOW_TOD);
-}
-
 void ucc_slow_graceful_stop_tx(struct ucc_slow_private * uccs)
 {
 	struct ucc_slow_info *us_info = uccs->us_info;
-- 
2.3.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 4/4] powerpc/mpic: remove unused functions
  2015-02-16 10:56 [PATCH 0/4] powerpc: trivial unused functions cleanup Arseny Solokha
                   ` (2 preceding siblings ...)
  2015-02-16 10:56 ` [PATCH 3/4] powrepc/qe: drop unused ucc_slow_poll_transmitter_now Arseny Solokha
@ 2015-02-16 10:56 ` Arseny Solokha
  2015-02-19  0:58   ` Michael Ellerman
  2015-02-24  9:05 ` [PATCH V2 0/4] powerpc: trivial unused functions cleanup Arseny Solokha
  4 siblings, 1 reply; 31+ messages in thread
From: Arseny Solokha @ 2015-02-16 10:56 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Paul Mackerras, Michael Ellerman, Scott Wood, linuxppc-dev,
	linux-kernel, Arseny Solokha

Drop unused fsl_mpic_primary_get_version(), mpic_set_clk_ratio(),
mpic_set_serial_int().

Signed-off-by: Arseny Solokha <asolokha@kb.kras.ru>
---
 arch/powerpc/include/asm/mpic.h | 16 ----------------
 arch/powerpc/sysdev/mpic.c      | 35 -----------------------------------
 2 files changed, 51 deletions(-)

diff --git a/arch/powerpc/include/asm/mpic.h b/arch/powerpc/include/asm/mpic.h
index 754f93d..3a2ab60 100644
--- a/arch/powerpc/include/asm/mpic.h
+++ b/arch/powerpc/include/asm/mpic.h
@@ -395,16 +395,6 @@ extern struct bus_type mpic_subsys;
 #define	MPIC_REGSET_STANDARD		MPIC_REGSET(0)	/* Original MPIC */
 #define	MPIC_REGSET_TSI108		MPIC_REGSET(1)	/* Tsi108/109 PIC */
 
-/* Get the version of primary MPIC */
-#ifdef CONFIG_MPIC
-extern u32 fsl_mpic_primary_get_version(void);
-#else
-static inline u32 fsl_mpic_primary_get_version(void)
-{
-	return 0;
-}
-#endif
-
 /* Allocate the controller structure and setup the linux irq descs
  * for the range if interrupts passed in. No HW initialization is
  * actually performed.
@@ -496,11 +486,5 @@ extern unsigned int mpic_get_coreint_irq(void);
 /* Fetch Machine Check interrupt from primary mpic */
 extern unsigned int mpic_get_mcirq(void);
 
-/* Set the EPIC clock ratio */
-void mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio);
-
-/* Enable/Disable EPIC serial interrupt mode */
-void mpic_set_serial_int(struct mpic *mpic, int enable);
-
 #endif /* __KERNEL__ */
 #endif	/* _ASM_POWERPC_MPIC_H */
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index bbfbbf2..f72b592 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -1219,16 +1219,6 @@ static u32 fsl_mpic_get_version(struct mpic *mpic)
  * Exported functions
  */
 
-u32 fsl_mpic_primary_get_version(void)
-{
-	struct mpic *mpic = mpic_primary;
-
-	if (mpic)
-		return fsl_mpic_get_version(mpic);
-
-	return 0;
-}
-
 struct mpic * __init mpic_alloc(struct device_node *node,
 				phys_addr_t phys_addr,
 				unsigned int flags,
@@ -1676,31 +1666,6 @@ void __init mpic_init(struct mpic *mpic)
 		mpic_err_int_init(mpic, MPIC_FSL_ERR_INT);
 }
 
-void __init mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio)
-{
-	u32 v;
-
-	v = mpic_read(mpic->gregs, MPIC_GREG_GLOBAL_CONF_1);
-	v &= ~MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO_MASK;
-	v |= MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO(clock_ratio);
-	mpic_write(mpic->gregs, MPIC_GREG_GLOBAL_CONF_1, v);
-}
-
-void __init mpic_set_serial_int(struct mpic *mpic, int enable)
-{
-	unsigned long flags;
-	u32 v;
-
-	raw_spin_lock_irqsave(&mpic_lock, flags);
-	v = mpic_read(mpic->gregs, MPIC_GREG_GLOBAL_CONF_1);
-	if (enable)
-		v |= MPIC_GREG_GLOBAL_CONF_1_SIE;
-	else
-		v &= ~MPIC_GREG_GLOBAL_CONF_1_SIE;
-	mpic_write(mpic->gregs, MPIC_GREG_GLOBAL_CONF_1, v);
-	raw_spin_unlock_irqrestore(&mpic_lock, flags);
-}
-
 void mpic_irq_set_priority(unsigned int irq, unsigned int pri)
 {
 	struct mpic *mpic = mpic_find(irq);
-- 
2.3.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: [PATCH 4/4] powerpc/mpic: remove unused functions
  2015-02-16 10:56 ` [PATCH 4/4] powerpc/mpic: remove unused functions Arseny Solokha
@ 2015-02-19  0:58   ` Michael Ellerman
  2015-02-19 12:26     ` Arseny Solokha
  0 siblings, 1 reply; 31+ messages in thread
From: Michael Ellerman @ 2015-02-19  0:58 UTC (permalink / raw)
  To: Arseny Solokha
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Scott Wood, linuxppc-dev,
	linux-kernel

On Mon, 2015-02-16 at 17:56 +0700, Arseny Solokha wrote:
> Drop unused fsl_mpic_primary_get_version(), mpic_set_clk_ratio(),
> mpic_set_serial_int().

I'm always happy to remove unused code, but the interesting question is why are
they unused? Please tell me in the changelog.

cheers



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 4/4] powerpc/mpic: remove unused functions
  2015-02-19  0:58   ` Michael Ellerman
@ 2015-02-19 12:26     ` Arseny Solokha
  2015-02-20  3:34       ` Michael Ellerman
  2015-02-23 21:31       ` Scott Wood
  0 siblings, 2 replies; 31+ messages in thread
From: Arseny Solokha @ 2015-02-19 12:26 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Scott Wood, linuxppc-dev,
	linux-kernel

> On Mon, 2015-02-16 at 17:56 +0700, Arseny Solokha wrote:
>> Drop unused fsl_mpic_primary_get_version(), mpic_set_clk_ratio(),
>> mpic_set_serial_int().
>
> I'm always happy to remove unused code, but the interesting question is why are
> they unused? Please tell me in the changelog.

To being able to give a definitive answer, it's necessary to understand
the intentions of original developers of these pieces. I just can tell
these functions have no users and trivial grepping easily proves it;
I've got the impression they are here only for the sake of
implementation completeness.

Two machines at hands, e300 and e500 based, boot and run without
regressions on my workload with this series applied. The removed code
seems also been rarely touched, so it seems the series is safe at least
in general. But I can't obviously express any strong point in support of
the series, so it's completely OK to leave things as is.

  + fsl_mpic_primary_get_version() is just a safe wrapper around
fsl_mpic_get_version() for SMP configurations. While the latter is
called explicitly for handling PIC initialization and setting up error
interrupt vector depending on PIC hardware version, the former isn't
used for anything.

  + As for mpic_set_clk_ratio() and mpic_set_serial_int(), they both
are almost nine years old[1] but still have no chance to be called even
from out-of-tree modules because they both are __init and of course
aren't exported. Non-demanded functionality?

Of course I'll include the last two paragraphs into the V2 patch
description if the explanation is convincing enough and you ACK it. If
the patch is safe it's also necessary to extend it a bit, making its
second part actually a complete revert of [1].


[1] https://lists.ozlabs.org/pipermail/linuxppc-dev/2006-June/023867.html


Arsény


> cheers

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 4/4] powerpc/mpic: remove unused functions
  2015-02-19 12:26     ` Arseny Solokha
@ 2015-02-20  3:34       ` Michael Ellerman
  2015-02-20  4:40         ` Arseny Solokha
  2015-02-23 21:31       ` Scott Wood
  1 sibling, 1 reply; 31+ messages in thread
From: Michael Ellerman @ 2015-02-20  3:34 UTC (permalink / raw)
  To: Arseny Solokha
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Scott Wood, linuxppc-dev,
	linux-kernel

On Thu, 2015-02-19 at 19:26 +0700, Arseny Solokha wrote:
> > On Mon, 2015-02-16 at 17:56 +0700, Arseny Solokha wrote:
> >> Drop unused fsl_mpic_primary_get_version(), mpic_set_clk_ratio(),
> >> mpic_set_serial_int().
> >
> > I'm always happy to remove unused code, but the interesting question is why are
> > they unused? Please tell me in the changelog.
> 
> To being able to give a definitive answer, it's necessary to understand
> the intentions of original developers of these pieces. I just can tell
> these functions have no users and trivial grepping easily proves it;
> I've got the impression they are here only for the sake of
> implementation completeness.

Yeah OK. I didn't expect you to read the minds of the developers who wrote the
code :)
 
> Two machines at hands, e300 and e500 based, boot and run without
> regressions on my workload with this series applied. The removed code
> seems also been rarely touched, so it seems the series is safe at least
> in general. But I can't obviously express any strong point in support of
> the series, so it's completely OK to leave things as is.

OK that's a good data point.

>   + fsl_mpic_primary_get_version() is just a safe wrapper around
> fsl_mpic_get_version() for SMP configurations. While the latter is
> called explicitly for handling PIC initialization and setting up error
> interrupt vector depending on PIC hardware version, the former isn't
> used for anything.
> 
>   + As for mpic_set_clk_ratio() and mpic_set_serial_int(), they both
> are almost nine years old[1] but still have no chance to be called even
> from out-of-tree modules because they both are __init and of course
> aren't exported. Non-demanded functionality?
> 
> Of course I'll include the last two paragraphs into the V2 patch
> description if the explanation is convincing enough and you ACK it. If
> the patch is safe it's also necessary to extend it a bit, making its
> second part actually a complete revert of [1].
> 
> [1] https://lists.ozlabs.org/pipermail/linuxppc-dev/2006-June/023867.html

That is more like what I was looking for.

If I just get a patch saying "removed unused foo()", I have to go and dig and
find out:
  - was it recently added and will be used soon?
  - is it ancient and never used, if so can we work out why, ie. feature X
    never landed so this code is no longer needed.
  - is it old code that *was* used but isn't now because commit ... removed the
    last user.
  - is it code that *should* be used, but isn't for some odd reason?


So if you can provide that sort of detail for me, that really adds value to the
patch. Otherwise the patch is basically just a TODO for me, to go and work out
why the code is unused.

cheers



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 4/4] powerpc/mpic: remove unused functions
  2015-02-20  3:34       ` Michael Ellerman
@ 2015-02-20  4:40         ` Arseny Solokha
  2015-02-24  4:48           ` Michael Ellerman
  0 siblings, 1 reply; 31+ messages in thread
From: Arseny Solokha @ 2015-02-20  4:40 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Scott Wood, linuxppc-dev,
	linux-kernel

> If I just get a patch saying "removed unused foo()", I have to go and dig and
> find out:
>   - was it recently added and will be used soon?
>   - is it ancient and never used, if so can we work out why, ie. feature X
>     never landed so this code is no longer needed.
>   - is it old code that *was* used but isn't now because commit ... removed the
>     last user.
>   - is it code that *should* be used, but isn't for some odd reason?
>
>
> So if you can provide that sort of detail for me, that really adds value to the
> patch. Otherwise the patch is basically just a TODO for me, to go and work out
> why the code is unused.

Got it. Will resend the whole series one of these days.

Arsény


> cheers

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 4/4] powerpc/mpic: remove unused functions
  2015-02-19 12:26     ` Arseny Solokha
  2015-02-20  3:34       ` Michael Ellerman
@ 2015-02-23 21:31       ` Scott Wood
  2015-02-26  2:39         ` Hongtao Jia
  1 sibling, 1 reply; 31+ messages in thread
From: Scott Wood @ 2015-02-23 21:31 UTC (permalink / raw)
  To: Arseny Solokha
  Cc: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
	linuxppc-dev, linux-kernel, hongtao.jia

On Thu, 2015-02-19 at 19:26 +0700, Arseny Solokha wrote:
>   + fsl_mpic_primary_get_version() is just a safe wrapper around
> fsl_mpic_get_version() for SMP configurations. While the latter is
> called explicitly for handling PIC initialization and setting up error
> interrupt vector depending on PIC hardware version, the former isn't
> used for anything.

It was meant to be used by http://patchwork.ozlabs.org/patch/233211/
which never got respun.  Hongtao, do you plan to revisit that patch?

-Scott



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 4/4] powerpc/mpic: remove unused functions
  2015-02-20  4:40         ` Arseny Solokha
@ 2015-02-24  4:48           ` Michael Ellerman
  0 siblings, 0 replies; 31+ messages in thread
From: Michael Ellerman @ 2015-02-24  4:48 UTC (permalink / raw)
  To: Arseny Solokha
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Scott Wood, linuxppc-dev,
	linux-kernel

On Fri, 2015-02-20 at 11:40 +0700, Arseny Solokha wrote:
> > If I just get a patch saying "removed unused foo()", I have to go and dig and
> > find out:
> >   - was it recently added and will be used soon?
> >   - is it ancient and never used, if so can we work out why, ie. feature X
> >     never landed so this code is no longer needed.
> >   - is it old code that *was* used but isn't now because commit ... removed the
> >     last user.
> >   - is it code that *should* be used, but isn't for some odd reason?
> >
> >
> > So if you can provide that sort of detail for me, that really adds value to the
> > patch. Otherwise the patch is basically just a TODO for me, to go and work out
> > why the code is unused.
> 
> Got it. Will resend the whole series one of these days.

Thanks.

cheers



^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH V2 0/4] powerpc: trivial unused functions cleanup
  2015-02-16 10:56 [PATCH 0/4] powerpc: trivial unused functions cleanup Arseny Solokha
                   ` (3 preceding siblings ...)
  2015-02-16 10:56 ` [PATCH 4/4] powerpc/mpic: remove unused functions Arseny Solokha
@ 2015-02-24  9:05 ` Arseny Solokha
  2015-02-24  9:05   ` [PATCH 1/4] powerpc/boot: drop planetcore_set_serial_speed Arseny Solokha
                     ` (4 more replies)
  4 siblings, 5 replies; 31+ messages in thread
From: Arseny Solokha @ 2015-02-24  9:05 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Paul Mackerras, Michael Ellerman, Scott Wood, linuxppc-dev,
	linux-kernel, Arseny Solokha

This series removes unused functions from powerpc tree that I've been
able to discover.

Two machines at hands, e300 and e500 based, boot and run without
regressions on my workload with this series applied. The removed code
seems also been rarely touched, so it seems the series is safe at least
in general. But I can't obviously express any strong point in support of
the series, so it's completely OK to leave things as is.

Arseny Solokha (4):
  powerpc/boot: drop planetcore_set_serial_speed
  kvm/ppc/mpic: drop unused IRQ_testbit
  powrepc/qe: drop unused ucc_slow_poll_transmitter_now
  powerpc/mpic: remove unused functions

 arch/powerpc/boot/planetcore.c        | 33 ---------------------------------
 arch/powerpc/boot/planetcore.h        |  3 ---
 arch/powerpc/include/asm/mpic.h       | 20 --------------------
 arch/powerpc/include/asm/ucc_slow.h   | 13 -------------
 arch/powerpc/kvm/mpic.c               |  5 -----
 arch/powerpc/sysdev/mpic.c            | 35 -----------------------------------
 arch/powerpc/sysdev/qe_lib/ucc_slow.c |  5 -----
 7 files changed, 114 deletions(-)

-- 
2.3.0


^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 1/4] powerpc/boot: drop planetcore_set_serial_speed
  2015-02-24  9:05 ` [PATCH V2 0/4] powerpc: trivial unused functions cleanup Arseny Solokha
@ 2015-02-24  9:05   ` Arseny Solokha
  2015-02-24  9:05   ` [PATCH 2/4] kvm/ppc/mpic: drop unused IRQ_testbit Arseny Solokha
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 31+ messages in thread
From: Arseny Solokha @ 2015-02-24  9:05 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Paul Mackerras, Michael Ellerman, Scott Wood, linuxppc-dev,
	linux-kernel, Arseny Solokha

Drop planetcore_set_serial_speed() which had no users since its
inception in commit fec6047047fd ("[POWERPC] bootwrapper: Add PlanetCore
firmware support") in 2007.

Signed-off-by: Arseny Solokha <asolokha@kb.kras.ru>
---
 arch/powerpc/boot/planetcore.c | 33 ---------------------------------
 arch/powerpc/boot/planetcore.h |  3 ---
 2 files changed, 36 deletions(-)

diff --git a/arch/powerpc/boot/planetcore.c b/arch/powerpc/boot/planetcore.c
index 0d8558a..75117e6 100644
--- a/arch/powerpc/boot/planetcore.c
+++ b/arch/powerpc/boot/planetcore.c
@@ -131,36 +131,3 @@ void planetcore_set_stdout_path(const char *table)
 
 	setprop_str(chosen, "linux,stdout-path", path);
 }
-
-void planetcore_set_serial_speed(const char *table)
-{
-	void *chosen, *stdout;
-	u64 baud;
-	u32 baud32;
-	int len;
-
-	chosen = finddevice("/chosen");
-	if (!chosen)
-		return;
-
-	len = getprop(chosen, "linux,stdout-path", prop_buf, MAX_PROP_LEN);
-	if (len <= 0)
-		return;
-
-	stdout = finddevice(prop_buf);
-	if (!stdout) {
-		printf("planetcore_set_serial_speed: "
-		       "Bad /chosen/linux,stdout-path.\r\n");
-
-		return;
-	}
-
-	if (!planetcore_get_decimal(table, PLANETCORE_KEY_SERIAL_BAUD,
-	                            &baud)) {
-		printf("planetcore_set_serial_speed: No SB tag.\r\n");
-		return;
-	}
-
-	baud32 = baud;
-	setprop(stdout, "current-speed", &baud32, 4);
-}
diff --git a/arch/powerpc/boot/planetcore.h b/arch/powerpc/boot/planetcore.h
index 0d4094f..d53c733 100644
--- a/arch/powerpc/boot/planetcore.h
+++ b/arch/powerpc/boot/planetcore.h
@@ -43,7 +43,4 @@ void planetcore_set_mac_addrs(const char *table);
  */
 void planetcore_set_stdout_path(const char *table);
 
-/* Sets the current-speed property in the serial node. */
-void planetcore_set_serial_speed(const char *table);
-
 #endif
-- 
2.3.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 2/4] kvm/ppc/mpic: drop unused IRQ_testbit
  2015-02-24  9:05 ` [PATCH V2 0/4] powerpc: trivial unused functions cleanup Arseny Solokha
  2015-02-24  9:05   ` [PATCH 1/4] powerpc/boot: drop planetcore_set_serial_speed Arseny Solokha
@ 2015-02-24  9:05   ` Arseny Solokha
  2015-02-24  9:05   ` [PATCH 3/4] powrepc/qe: drop unused ucc_slow_poll_transmitter_now Arseny Solokha
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 31+ messages in thread
From: Arseny Solokha @ 2015-02-24  9:05 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Paul Mackerras, Michael Ellerman, Scott Wood, linuxppc-dev,
	linux-kernel, Arseny Solokha, Alexander Graf, Gleb Natapov,
	Paolo Bonzini

Drop unused static procedure which doesn't have callers within its
translation unit. It had been already removed independently in QEMU[1]
from the OpenPIC implementation borrowed from the kernel.

[1] https://lists.gnu.org/archive/html/qemu-devel/2014-06/msg01812.html

Signed-off-by: Arseny Solokha <asolokha@kb.kras.ru>
Cc: Alexander Graf <agraf@suse.de>
Cc: Gleb Natapov <gleb@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
---
 arch/powerpc/kvm/mpic.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/arch/powerpc/kvm/mpic.c b/arch/powerpc/kvm/mpic.c
index 39b3a8f..a480d99 100644
--- a/arch/powerpc/kvm/mpic.c
+++ b/arch/powerpc/kvm/mpic.c
@@ -289,11 +289,6 @@ static inline void IRQ_resetbit(struct irq_queue *q, int n_IRQ)
 	clear_bit(n_IRQ, q->queue);
 }
 
-static inline int IRQ_testbit(struct irq_queue *q, int n_IRQ)
-{
-	return test_bit(n_IRQ, q->queue);
-}
-
 static void IRQ_check(struct openpic *opp, struct irq_queue *q)
 {
 	int irq = -1;
-- 
2.3.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3/4] powrepc/qe: drop unused ucc_slow_poll_transmitter_now
  2015-02-24  9:05 ` [PATCH V2 0/4] powerpc: trivial unused functions cleanup Arseny Solokha
  2015-02-24  9:05   ` [PATCH 1/4] powerpc/boot: drop planetcore_set_serial_speed Arseny Solokha
  2015-02-24  9:05   ` [PATCH 2/4] kvm/ppc/mpic: drop unused IRQ_testbit Arseny Solokha
@ 2015-02-24  9:05   ` Arseny Solokha
  2015-02-24  9:05   ` [PATCH 4/4] powerpc/mpic: remove unused functions Arseny Solokha
  2015-03-20  3:56   ` [PATCH v3 0/4] powerpc: trivial unused functions cleanup Arseny Solokha
  4 siblings, 0 replies; 31+ messages in thread
From: Arseny Solokha @ 2015-02-24  9:05 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Paul Mackerras, Michael Ellerman, Scott Wood, linuxppc-dev,
	linux-kernel, Arseny Solokha

Drop ucc_slow_poll_transmitter_now() which has no users since its
inception in 2007 in commit 986585385131 ("[POWERPC] Add QUICC
Engine (QE) infrastructure").

Signed-off-by: Arseny Solokha <asolokha@kb.kras.ru>
---
 arch/powerpc/include/asm/ucc_slow.h   | 13 -------------
 arch/powerpc/sysdev/qe_lib/ucc_slow.c |  5 -----
 2 files changed, 18 deletions(-)

diff --git a/arch/powerpc/include/asm/ucc_slow.h b/arch/powerpc/include/asm/ucc_slow.h
index c44131e..233ef5f 100644
--- a/arch/powerpc/include/asm/ucc_slow.h
+++ b/arch/powerpc/include/asm/ucc_slow.h
@@ -251,19 +251,6 @@ void ucc_slow_enable(struct ucc_slow_private * uccs, enum comm_dir mode);
  */
 void ucc_slow_disable(struct ucc_slow_private * uccs, enum comm_dir mode);
 
-/* ucc_slow_poll_transmitter_now
- * Immediately forces a poll of the transmitter for data to be sent.
- * Typically, the hardware performs a periodic poll for data that the
- * transmit routine has set up to be transmitted. In cases where
- * this polling cycle is not soon enough, this optional routine can
- * be invoked to force a poll right away, instead. Proper use for
- * each transmission for which this functionality is desired is to
- * call the transmit routine and then this routine right after.
- *
- * uccs - (In) pointer to the slow UCC structure.
- */
-void ucc_slow_poll_transmitter_now(struct ucc_slow_private * uccs);
-
 /* ucc_slow_graceful_stop_tx
  * Smoothly stops transmission on a specified slow UCC.
  *
diff --git a/arch/powerpc/sysdev/qe_lib/ucc_slow.c b/arch/powerpc/sysdev/qe_lib/ucc_slow.c
index befaf11..5f91628 100644
--- a/arch/powerpc/sysdev/qe_lib/ucc_slow.c
+++ b/arch/powerpc/sysdev/qe_lib/ucc_slow.c
@@ -43,11 +43,6 @@ u32 ucc_slow_get_qe_cr_subblock(int uccs_num)
 }
 EXPORT_SYMBOL(ucc_slow_get_qe_cr_subblock);
 
-void ucc_slow_poll_transmitter_now(struct ucc_slow_private * uccs)
-{
-	out_be16(&uccs->us_regs->utodr, UCC_SLOW_TOD);
-}
-
 void ucc_slow_graceful_stop_tx(struct ucc_slow_private * uccs)
 {
 	struct ucc_slow_info *us_info = uccs->us_info;
-- 
2.3.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 4/4] powerpc/mpic: remove unused functions
  2015-02-24  9:05 ` [PATCH V2 0/4] powerpc: trivial unused functions cleanup Arseny Solokha
                     ` (2 preceding siblings ...)
  2015-02-24  9:05   ` [PATCH 3/4] powrepc/qe: drop unused ucc_slow_poll_transmitter_now Arseny Solokha
@ 2015-02-24  9:05   ` Arseny Solokha
  2015-02-27  2:25     ` Arseny Solokha
  2015-03-20  3:56   ` [PATCH v3 0/4] powerpc: trivial unused functions cleanup Arseny Solokha
  4 siblings, 1 reply; 31+ messages in thread
From: Arseny Solokha @ 2015-02-24  9:05 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Paul Mackerras, Michael Ellerman, Scott Wood, linuxppc-dev,
	linux-kernel, Arseny Solokha, hongtao.jia

Drop unused fsl_mpic_primary_get_version(), mpic_set_clk_ratio(),
mpic_set_serial_int().

  + fsl_mpic_primary_get_version() is just a safe wrapper around
fsl_mpic_get_version() for SMP configurations. While the latter is
called explicitly for handling PIC initialization and setting up error
interrupt vector depending on PIC hardware version, the former isn't
used for anything.

  + As for mpic_set_clk_ratio() and mpic_set_serial_int(), they both are
almost nine years old[1] but still have no chance to be called even from
out-of-tree modules because they both are __init and of course aren't
exported.

[1] https://lists.ozlabs.org/pipermail/linuxppc-dev/2006-June/023867.html

Signed-off-by: Arseny Solokha <asolokha@kb.kras.ru>
Cc: hongtao.jia@freescale.com
---
 arch/powerpc/include/asm/mpic.h | 20 --------------------
 arch/powerpc/sysdev/mpic.c      | 35 -----------------------------------
 2 files changed, 55 deletions(-)

diff --git a/arch/powerpc/include/asm/mpic.h b/arch/powerpc/include/asm/mpic.h
index 754f93d..6ce63a7 100644
--- a/arch/powerpc/include/asm/mpic.h
+++ b/arch/powerpc/include/asm/mpic.h
@@ -34,10 +34,6 @@
 #define		MPIC_GREG_GCONF_BASE_MASK		0x000fffff
 #define		MPIC_GREG_GCONF_MCK			0x08000000
 #define MPIC_GREG_GLOBAL_CONF_1		0x00030
-#define		MPIC_GREG_GLOBAL_CONF_1_SIE		0x08000000
-#define		MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO_MASK	0x70000000
-#define		MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO(r)	\
-			(((r) << 28) & MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO_MASK)
 #define MPIC_GREG_VENDOR_0		0x00040
 #define MPIC_GREG_VENDOR_1		0x00050
 #define MPIC_GREG_VENDOR_2		0x00060
@@ -395,16 +391,6 @@ extern struct bus_type mpic_subsys;
 #define	MPIC_REGSET_STANDARD		MPIC_REGSET(0)	/* Original MPIC */
 #define	MPIC_REGSET_TSI108		MPIC_REGSET(1)	/* Tsi108/109 PIC */
 
-/* Get the version of primary MPIC */
-#ifdef CONFIG_MPIC
-extern u32 fsl_mpic_primary_get_version(void);
-#else
-static inline u32 fsl_mpic_primary_get_version(void)
-{
-	return 0;
-}
-#endif
-
 /* Allocate the controller structure and setup the linux irq descs
  * for the range if interrupts passed in. No HW initialization is
  * actually performed.
@@ -496,11 +482,5 @@ extern unsigned int mpic_get_coreint_irq(void);
 /* Fetch Machine Check interrupt from primary mpic */
 extern unsigned int mpic_get_mcirq(void);
 
-/* Set the EPIC clock ratio */
-void mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio);
-
-/* Enable/Disable EPIC serial interrupt mode */
-void mpic_set_serial_int(struct mpic *mpic, int enable);
-
 #endif /* __KERNEL__ */
 #endif	/* _ASM_POWERPC_MPIC_H */
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index bbfbbf2..f72b592 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -1219,16 +1219,6 @@ static u32 fsl_mpic_get_version(struct mpic *mpic)
  * Exported functions
  */
 
-u32 fsl_mpic_primary_get_version(void)
-{
-	struct mpic *mpic = mpic_primary;
-
-	if (mpic)
-		return fsl_mpic_get_version(mpic);
-
-	return 0;
-}
-
 struct mpic * __init mpic_alloc(struct device_node *node,
 				phys_addr_t phys_addr,
 				unsigned int flags,
@@ -1676,31 +1666,6 @@ void __init mpic_init(struct mpic *mpic)
 		mpic_err_int_init(mpic, MPIC_FSL_ERR_INT);
 }
 
-void __init mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio)
-{
-	u32 v;
-
-	v = mpic_read(mpic->gregs, MPIC_GREG_GLOBAL_CONF_1);
-	v &= ~MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO_MASK;
-	v |= MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO(clock_ratio);
-	mpic_write(mpic->gregs, MPIC_GREG_GLOBAL_CONF_1, v);
-}
-
-void __init mpic_set_serial_int(struct mpic *mpic, int enable)
-{
-	unsigned long flags;
-	u32 v;
-
-	raw_spin_lock_irqsave(&mpic_lock, flags);
-	v = mpic_read(mpic->gregs, MPIC_GREG_GLOBAL_CONF_1);
-	if (enable)
-		v |= MPIC_GREG_GLOBAL_CONF_1_SIE;
-	else
-		v &= ~MPIC_GREG_GLOBAL_CONF_1_SIE;
-	mpic_write(mpic->gregs, MPIC_GREG_GLOBAL_CONF_1, v);
-	raw_spin_unlock_irqrestore(&mpic_lock, flags);
-}
-
 void mpic_irq_set_priority(unsigned int irq, unsigned int pri)
 {
 	struct mpic *mpic = mpic_find(irq);
-- 
2.3.0


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* RE: [PATCH 4/4] powerpc/mpic: remove unused functions
  2015-02-23 21:31       ` Scott Wood
@ 2015-02-26  2:39         ` Hongtao Jia
  2015-02-26  3:27           ` Scott Wood
  0 siblings, 1 reply; 31+ messages in thread
From: Hongtao Jia @ 2015-02-26  2:39 UTC (permalink / raw)
  To: Scott Wood, Arseny Solokha
  Cc: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
	linuxppc-dev, linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1299 bytes --]

Hi Scott,

I'm really sorry for leave this patch like a zombie.
Now I have plan to revisit this patch.

>From the previous comments the compile error was fixed.
But beyond that I have had no plan to update it.

Could you please comment on why it's still on hold?

Thanks.


> -----Original Message-----
> From: Wood Scott-B07421
> Sent: Tuesday, February 24, 2015 5:32 AM
> To: Arseny Solokha
> Cc: Michael Ellerman; Benjamin Herrenschmidt; Paul Mackerras; linuxppc-
> dev@lists.ozlabs.org; linux-kernel@vger.kernel.org; Jia Hongtao-B38951
> Subject: Re: [PATCH 4/4] powerpc/mpic: remove unused functions
> 
> On Thu, 2015-02-19 at 19:26 +0700, Arseny Solokha wrote:
> >   + fsl_mpic_primary_get_version() is just a safe wrapper around
> > fsl_mpic_get_version() for SMP configurations. While the latter is
> > called explicitly for handling PIC initialization and setting up error
> > interrupt vector depending on PIC hardware version, the former isn't
> > used for anything.
> 
> It was meant to be used by http://patchwork.ozlabs.org/patch/233211/
> which never got respun.  Hongtao, do you plan to revisit that patch?
> 
> -Scott
> 

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 4/4] powerpc/mpic: remove unused functions
  2015-02-26  2:39         ` Hongtao Jia
@ 2015-02-26  3:27           ` Scott Wood
  0 siblings, 0 replies; 31+ messages in thread
From: Scott Wood @ 2015-02-26  3:27 UTC (permalink / raw)
  To: Jia Hongtao-B38951
  Cc: Arseny Solokha, Michael Ellerman, Benjamin Herrenschmidt,
	Paul Mackerras, linuxppc-dev, linux-kernel

On Wed, 2015-02-25 at 20:39 -0600, Jia Hongtao-B38951 wrote:
> Hi Scott,
> 
> I'm really sorry for leave this patch like a zombie.
> Now I have plan to revisit this patch.
> 
> From the previous comments the compile error was fixed.
> But beyond that I have had no plan to update it.
> 
> Could you please comment on why it's still on hold?
> 

Kumar had some comments.

-Scott



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 4/4] powerpc/mpic: remove unused functions
  2015-02-24  9:05   ` [PATCH 4/4] powerpc/mpic: remove unused functions Arseny Solokha
@ 2015-02-27  2:25     ` Arseny Solokha
  0 siblings, 0 replies; 31+ messages in thread
From: Arseny Solokha @ 2015-02-27  2:25 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Paul Mackerras, Michael Ellerman, Scott Wood, linuxppc-dev,
	linux-kernel, hongtao.jia

> @@ -1676,31 +1666,6 @@ void __init mpic_init(struct mpic *mpic)
>  		mpic_err_int_init(mpic, MPIC_FSL_ERR_INT);
>  }
>  
> -void __init mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio)
> -{
> -	u32 v;
> -
> -	v = mpic_read(mpic->gregs, MPIC_GREG_GLOBAL_CONF_1);
> -	v &= ~MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO_MASK;
> -	v |= MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO(clock_ratio);
> -	mpic_write(mpic->gregs, MPIC_GREG_GLOBAL_CONF_1, v);
> -}
> -
> -void __init mpic_set_serial_int(struct mpic *mpic, int enable)
> -{
> -	unsigned long flags;
> -	u32 v;
> -
> -	raw_spin_lock_irqsave(&mpic_lock, flags);
> -	v = mpic_read(mpic->gregs, MPIC_GREG_GLOBAL_CONF_1);
> -	if (enable)
> -		v |= MPIC_GREG_GLOBAL_CONF_1_SIE;
> -	else
> -		v &= ~MPIC_GREG_GLOBAL_CONF_1_SIE;
> -	mpic_write(mpic->gregs, MPIC_GREG_GLOBAL_CONF_1, v);
> -	raw_spin_unlock_irqrestore(&mpic_lock, flags);
> -}
> -
>  void mpic_irq_set_priority(unsigned int irq, unsigned int pri)
>  {
>  	struct mpic *mpic = mpic_find(irq);

Thinking about it some more, I wonder whether it makes sense to propagate these
values through device tree (and refuse to apply them if they are 0), just like
what timer_group_get_freq() and timer_group_get_irq() in
arch/powerpc/sysdev/mpic_timer.c do.

Does it have any real use?

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH v3 0/4] powerpc: trivial unused functions cleanup
  2015-02-24  9:05 ` [PATCH V2 0/4] powerpc: trivial unused functions cleanup Arseny Solokha
                     ` (3 preceding siblings ...)
  2015-02-24  9:05   ` [PATCH 4/4] powerpc/mpic: remove unused functions Arseny Solokha
@ 2015-03-20  3:56   ` Arseny Solokha
  2015-03-20  3:56     ` [PATCH 1/4] powerpc/boot: drop planetcore_set_serial_speed Arseny Solokha
                       ` (4 more replies)
  4 siblings, 5 replies; 31+ messages in thread
From: Arseny Solokha @ 2015-03-20  3:56 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Paul Mackerras, Michael Ellerman, Scott Wood, linuxppc-dev,
	linux-kernel, Arseny Solokha

This series removes unused functions from powerpc tree that I've been able
to discover.

Two machines at hands, e300 and e500 based, boot and run without regressions
on my workload with this series applied. The removed code seems also been
rarely touched, so it seems the series is safe at least in general. But I
can't obviously express any strong point in support of the series, so it's
completely OK to leave things as is.

v3: In patch 4/4, do not remove fsl_mpic_primary_get_version() from
    arch/powerpc/sysdev/mpic.c because the patch by Jia Hongtao
    ("powerpc/85xx: workaround for chips with MSI hardware errata") makes
    use of it.

v2: Added a brief explanation to each patch description of why removed
    functions are unused, as suggested by Michael Ellerman.

Arseny Solokha (4):
  powerpc/boot: drop planetcore_set_serial_speed
  kvm/ppc/mpic: drop unused IRQ_testbit
  powrepc/qe: drop unused ucc_slow_poll_transmitter_now
  powerpc/mpic: remove unused functions

 arch/powerpc/boot/planetcore.c        | 33 ---------------------------------
 arch/powerpc/boot/planetcore.h        |  3 ---
 arch/powerpc/include/asm/mpic.h       | 11 -----------
 arch/powerpc/include/asm/ucc_slow.h   | 13 -------------
 arch/powerpc/kvm/mpic.c               |  5 -----
 arch/powerpc/sysdev/mpic.c            | 25 -------------------------
 arch/powerpc/sysdev/qe_lib/ucc_slow.c |  5 -----
 7 files changed, 95 deletions(-)

-- 
2.3.3


^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 1/4] powerpc/boot: drop planetcore_set_serial_speed
  2015-03-20  3:56   ` [PATCH v3 0/4] powerpc: trivial unused functions cleanup Arseny Solokha
@ 2015-03-20  3:56     ` Arseny Solokha
  2015-03-20  3:56     ` [PATCH 2/4] kvm/ppc/mpic: drop unused IRQ_testbit Arseny Solokha
                       ` (3 subsequent siblings)
  4 siblings, 0 replies; 31+ messages in thread
From: Arseny Solokha @ 2015-03-20  3:56 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Paul Mackerras, Michael Ellerman, Scott Wood, linuxppc-dev,
	linux-kernel, Arseny Solokha

Drop planetcore_set_serial_speed() which had no users since its
inception in commit fec6047047fd ("[POWERPC] bootwrapper: Add PlanetCore
firmware support") in 2007.

Signed-off-by: Arseny Solokha <asolokha@kb.kras.ru>
---
 arch/powerpc/boot/planetcore.c | 33 ---------------------------------
 arch/powerpc/boot/planetcore.h |  3 ---
 2 files changed, 36 deletions(-)

diff --git a/arch/powerpc/boot/planetcore.c b/arch/powerpc/boot/planetcore.c
index 0d8558a..75117e6 100644
--- a/arch/powerpc/boot/planetcore.c
+++ b/arch/powerpc/boot/planetcore.c
@@ -131,36 +131,3 @@ void planetcore_set_stdout_path(const char *table)
 
 	setprop_str(chosen, "linux,stdout-path", path);
 }
-
-void planetcore_set_serial_speed(const char *table)
-{
-	void *chosen, *stdout;
-	u64 baud;
-	u32 baud32;
-	int len;
-
-	chosen = finddevice("/chosen");
-	if (!chosen)
-		return;
-
-	len = getprop(chosen, "linux,stdout-path", prop_buf, MAX_PROP_LEN);
-	if (len <= 0)
-		return;
-
-	stdout = finddevice(prop_buf);
-	if (!stdout) {
-		printf("planetcore_set_serial_speed: "
-		       "Bad /chosen/linux,stdout-path.\r\n");
-
-		return;
-	}
-
-	if (!planetcore_get_decimal(table, PLANETCORE_KEY_SERIAL_BAUD,
-	                            &baud)) {
-		printf("planetcore_set_serial_speed: No SB tag.\r\n");
-		return;
-	}
-
-	baud32 = baud;
-	setprop(stdout, "current-speed", &baud32, 4);
-}
diff --git a/arch/powerpc/boot/planetcore.h b/arch/powerpc/boot/planetcore.h
index 0d4094f..d53c733 100644
--- a/arch/powerpc/boot/planetcore.h
+++ b/arch/powerpc/boot/planetcore.h
@@ -43,7 +43,4 @@ void planetcore_set_mac_addrs(const char *table);
  */
 void planetcore_set_stdout_path(const char *table);
 
-/* Sets the current-speed property in the serial node. */
-void planetcore_set_serial_speed(const char *table);
-
 #endif
-- 
2.3.3


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 2/4] kvm/ppc/mpic: drop unused IRQ_testbit
  2015-03-20  3:56   ` [PATCH v3 0/4] powerpc: trivial unused functions cleanup Arseny Solokha
  2015-03-20  3:56     ` [PATCH 1/4] powerpc/boot: drop planetcore_set_serial_speed Arseny Solokha
@ 2015-03-20  3:56     ` Arseny Solokha
  2015-03-20 11:41       ` Alexander Graf
  2015-03-20  3:56     ` [PATCH 3/4] powrepc/qe: drop unused ucc_slow_poll_transmitter_now Arseny Solokha
                       ` (2 subsequent siblings)
  4 siblings, 1 reply; 31+ messages in thread
From: Arseny Solokha @ 2015-03-20  3:56 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Paul Mackerras, Michael Ellerman, Scott Wood, linuxppc-dev,
	linux-kernel, Arseny Solokha, Alexander Graf, Gleb Natapov,
	Paolo Bonzini

Drop unused static procedure which doesn't have callers within its
translation unit. It had been already removed independently in QEMU[1]
from the OpenPIC implementation borrowed from the kernel.

[1] https://lists.gnu.org/archive/html/qemu-devel/2014-06/msg01812.html

Signed-off-by: Arseny Solokha <asolokha@kb.kras.ru>
Cc: Alexander Graf <agraf@suse.de>
Cc: Gleb Natapov <gleb@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
---
 arch/powerpc/kvm/mpic.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/arch/powerpc/kvm/mpic.c b/arch/powerpc/kvm/mpic.c
index 39b3a8f..a480d99 100644
--- a/arch/powerpc/kvm/mpic.c
+++ b/arch/powerpc/kvm/mpic.c
@@ -289,11 +289,6 @@ static inline void IRQ_resetbit(struct irq_queue *q, int n_IRQ)
 	clear_bit(n_IRQ, q->queue);
 }
 
-static inline int IRQ_testbit(struct irq_queue *q, int n_IRQ)
-{
-	return test_bit(n_IRQ, q->queue);
-}
-
 static void IRQ_check(struct openpic *opp, struct irq_queue *q)
 {
 	int irq = -1;
-- 
2.3.3


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 3/4] powrepc/qe: drop unused ucc_slow_poll_transmitter_now
  2015-03-20  3:56   ` [PATCH v3 0/4] powerpc: trivial unused functions cleanup Arseny Solokha
  2015-03-20  3:56     ` [PATCH 1/4] powerpc/boot: drop planetcore_set_serial_speed Arseny Solokha
  2015-03-20  3:56     ` [PATCH 2/4] kvm/ppc/mpic: drop unused IRQ_testbit Arseny Solokha
@ 2015-03-20  3:56     ` Arseny Solokha
  2015-03-20  3:56     ` [PATCH 4/4] powerpc/mpic: remove unused functions Arseny Solokha
  2015-03-20  4:23     ` [PATCH v3 0/4] powerpc: trivial unused functions cleanup Michael Ellerman
  4 siblings, 0 replies; 31+ messages in thread
From: Arseny Solokha @ 2015-03-20  3:56 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Paul Mackerras, Michael Ellerman, Scott Wood, linuxppc-dev,
	linux-kernel, Arseny Solokha

Drop ucc_slow_poll_transmitter_now() which has no users since its
inception in 2007 in commit 986585385131 ("[POWERPC] Add QUICC
Engine (QE) infrastructure").

Signed-off-by: Arseny Solokha <asolokha@kb.kras.ru>
---
 arch/powerpc/include/asm/ucc_slow.h   | 13 -------------
 arch/powerpc/sysdev/qe_lib/ucc_slow.c |  5 -----
 2 files changed, 18 deletions(-)

diff --git a/arch/powerpc/include/asm/ucc_slow.h b/arch/powerpc/include/asm/ucc_slow.h
index c44131e..233ef5f 100644
--- a/arch/powerpc/include/asm/ucc_slow.h
+++ b/arch/powerpc/include/asm/ucc_slow.h
@@ -251,19 +251,6 @@ void ucc_slow_enable(struct ucc_slow_private * uccs, enum comm_dir mode);
  */
 void ucc_slow_disable(struct ucc_slow_private * uccs, enum comm_dir mode);
 
-/* ucc_slow_poll_transmitter_now
- * Immediately forces a poll of the transmitter for data to be sent.
- * Typically, the hardware performs a periodic poll for data that the
- * transmit routine has set up to be transmitted. In cases where
- * this polling cycle is not soon enough, this optional routine can
- * be invoked to force a poll right away, instead. Proper use for
- * each transmission for which this functionality is desired is to
- * call the transmit routine and then this routine right after.
- *
- * uccs - (In) pointer to the slow UCC structure.
- */
-void ucc_slow_poll_transmitter_now(struct ucc_slow_private * uccs);
-
 /* ucc_slow_graceful_stop_tx
  * Smoothly stops transmission on a specified slow UCC.
  *
diff --git a/arch/powerpc/sysdev/qe_lib/ucc_slow.c b/arch/powerpc/sysdev/qe_lib/ucc_slow.c
index befaf11..5f91628 100644
--- a/arch/powerpc/sysdev/qe_lib/ucc_slow.c
+++ b/arch/powerpc/sysdev/qe_lib/ucc_slow.c
@@ -43,11 +43,6 @@ u32 ucc_slow_get_qe_cr_subblock(int uccs_num)
 }
 EXPORT_SYMBOL(ucc_slow_get_qe_cr_subblock);
 
-void ucc_slow_poll_transmitter_now(struct ucc_slow_private * uccs)
-{
-	out_be16(&uccs->us_regs->utodr, UCC_SLOW_TOD);
-}
-
 void ucc_slow_graceful_stop_tx(struct ucc_slow_private * uccs)
 {
 	struct ucc_slow_info *us_info = uccs->us_info;
-- 
2.3.3


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 4/4] powerpc/mpic: remove unused functions
  2015-03-20  3:56   ` [PATCH v3 0/4] powerpc: trivial unused functions cleanup Arseny Solokha
                       ` (2 preceding siblings ...)
  2015-03-20  3:56     ` [PATCH 3/4] powrepc/qe: drop unused ucc_slow_poll_transmitter_now Arseny Solokha
@ 2015-03-20  3:56     ` Arseny Solokha
  2015-03-20  4:23     ` [PATCH v3 0/4] powerpc: trivial unused functions cleanup Michael Ellerman
  4 siblings, 0 replies; 31+ messages in thread
From: Arseny Solokha @ 2015-03-20  3:56 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Paul Mackerras, Michael Ellerman, Scott Wood, linuxppc-dev,
	linux-kernel, Arseny Solokha, Jia Hongtao

Drop unused mpic_set_clk_ratio() and mpic_set_serial_int().

Both functions are almost nine years old[1] but still have no chance
to be called even from out-of-tree modules because they both are __init
and of course aren't exported.

[1] https://lists.ozlabs.org/pipermail/linuxppc-dev/2006-June/023867.html

Signed-off-by: Arseny Solokha <asolokha@kb.kras.ru>
Cc: Jia Hongtao <hongtao.jia@freescale.com>
---
 arch/powerpc/include/asm/mpic.h | 11 -----------
 arch/powerpc/sysdev/mpic.c      | 25 -------------------------
 2 files changed, 36 deletions(-)

diff --git a/arch/powerpc/include/asm/mpic.h b/arch/powerpc/include/asm/mpic.h
index 754f93d..3b39c28 100644
--- a/arch/powerpc/include/asm/mpic.h
+++ b/arch/powerpc/include/asm/mpic.h
@@ -33,11 +33,6 @@
 #define		MPIC_GREG_GCONF_NO_BIAS			0x10000000
 #define		MPIC_GREG_GCONF_BASE_MASK		0x000fffff
 #define		MPIC_GREG_GCONF_MCK			0x08000000
-#define MPIC_GREG_GLOBAL_CONF_1		0x00030
-#define		MPIC_GREG_GLOBAL_CONF_1_SIE		0x08000000
-#define		MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO_MASK	0x70000000
-#define		MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO(r)	\
-			(((r) << 28) & MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO_MASK)
 #define MPIC_GREG_VENDOR_0		0x00040
 #define MPIC_GREG_VENDOR_1		0x00050
 #define MPIC_GREG_VENDOR_2		0x00060
@@ -496,11 +491,5 @@ extern unsigned int mpic_get_coreint_irq(void);
 /* Fetch Machine Check interrupt from primary mpic */
 extern unsigned int mpic_get_mcirq(void);
 
-/* Set the EPIC clock ratio */
-void mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio);
-
-/* Enable/Disable EPIC serial interrupt mode */
-void mpic_set_serial_int(struct mpic *mpic, int enable);
-
 #endif /* __KERNEL__ */
 #endif	/* _ASM_POWERPC_MPIC_H */
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index bbfbbf2..2c817a7 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -1676,31 +1676,6 @@ void __init mpic_init(struct mpic *mpic)
 		mpic_err_int_init(mpic, MPIC_FSL_ERR_INT);
 }
 
-void __init mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio)
-{
-	u32 v;
-
-	v = mpic_read(mpic->gregs, MPIC_GREG_GLOBAL_CONF_1);
-	v &= ~MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO_MASK;
-	v |= MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO(clock_ratio);
-	mpic_write(mpic->gregs, MPIC_GREG_GLOBAL_CONF_1, v);
-}
-
-void __init mpic_set_serial_int(struct mpic *mpic, int enable)
-{
-	unsigned long flags;
-	u32 v;
-
-	raw_spin_lock_irqsave(&mpic_lock, flags);
-	v = mpic_read(mpic->gregs, MPIC_GREG_GLOBAL_CONF_1);
-	if (enable)
-		v |= MPIC_GREG_GLOBAL_CONF_1_SIE;
-	else
-		v &= ~MPIC_GREG_GLOBAL_CONF_1_SIE;
-	mpic_write(mpic->gregs, MPIC_GREG_GLOBAL_CONF_1, v);
-	raw_spin_unlock_irqrestore(&mpic_lock, flags);
-}
-
 void mpic_irq_set_priority(unsigned int irq, unsigned int pri)
 {
 	struct mpic *mpic = mpic_find(irq);
-- 
2.3.3


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: [PATCH v3 0/4] powerpc: trivial unused functions cleanup
  2015-03-20  3:56   ` [PATCH v3 0/4] powerpc: trivial unused functions cleanup Arseny Solokha
                       ` (3 preceding siblings ...)
  2015-03-20  3:56     ` [PATCH 4/4] powerpc/mpic: remove unused functions Arseny Solokha
@ 2015-03-20  4:23     ` Michael Ellerman
  2015-03-20  4:55       ` Arseny Solokha
  4 siblings, 1 reply; 31+ messages in thread
From: Michael Ellerman @ 2015-03-20  4:23 UTC (permalink / raw)
  To: Arseny Solokha
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Scott Wood, linuxppc-dev,
	linux-kernel

On Fri, 2015-03-20 at 10:56 +0700, Arseny Solokha wrote:
> This series removes unused functions from powerpc tree that I've been able
> to discover.
> 
> Two machines at hands, e300 and e500 based, boot and run without regressions
> on my workload with this series applied. The removed code seems also been
> rarely touched, so it seems the series is safe at least in general. But I
> can't obviously express any strong point in support of the series, so it's
> completely OK to leave things as is.
> 
> v3: In patch 4/4, do not remove fsl_mpic_primary_get_version() from
>     arch/powerpc/sysdev/mpic.c because the patch by Jia Hongtao
>     ("powerpc/85xx: workaround for chips with MSI hardware errata") makes
>     use of it.

Sorry, too late.

https://git.kernel.org/cgit/linux/kernel/git/mpe/linux.git/commit/?h=next&id=5e86bfde9cd93f272844c3ff6ac5f93d3666b3e7


The patch that needs it can just add it back.

cheers



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v3 0/4] powerpc: trivial unused functions cleanup
  2015-03-20  4:23     ` [PATCH v3 0/4] powerpc: trivial unused functions cleanup Michael Ellerman
@ 2015-03-20  4:55       ` Arseny Solokha
  2015-03-20  5:39         ` Michael Ellerman
  0 siblings, 1 reply; 31+ messages in thread
From: Arseny Solokha @ 2015-03-20  4:55 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Scott Wood, linuxppc-dev,
	linux-kernel

> On Fri, 2015-03-20 at 10:56 +0700, Arseny Solokha wrote:
>> This series removes unused functions from powerpc tree that I've been able
>> to discover.
>> 
>> Two machines at hands, e300 and e500 based, boot and run without regressions
>> on my workload with this series applied. The removed code seems also been
>> rarely touched, so it seems the series is safe at least in general. But I
>> can't obviously express any strong point in support of the series, so it's
>> completely OK to leave things as is.
>> 
>> v3: In patch 4/4, do not remove fsl_mpic_primary_get_version() from
>>     arch/powerpc/sysdev/mpic.c because the patch by Jia Hongtao
>>     ("powerpc/85xx: workaround for chips with MSI hardware errata") makes
>>     use of it.
>
> Sorry, too late.
>
> https://git.kernel.org/cgit/linux/kernel/git/mpe/linux.git/commit/?h=next&id=5e86bfde9cd93f272844c3ff6ac5f93d3666b3e7
>
>
> The patch that needs it can just add it back.

I failed to notice that the series has been finally committed, so resent it. Of
course Hongtao can add the removed function back if he needs to.

And by the way, while revisiting the series I've noticed that though the patch
4/4 basically reverts [1], it leaves

  #define MPIC_GREG_GLOBAL_CONF_1		0x00030

in arch/powerpc/include/asm/mpic.h untouched. That define also loses its uses
after applying the patch. Compare the following hunk in today's patch w/ the one
you committed:

  @@ -33,11 +33,6 @@
   #define		MPIC_GREG_GCONF_NO_BIAS			0x10000000
   #define		MPIC_GREG_GCONF_BASE_MASK		0x000fffff
   #define		MPIC_GREG_GCONF_MCK			0x08000000
  -#define MPIC_GREG_GLOBAL_CONF_1		0x00030
  -#define		MPIC_GREG_GLOBAL_CONF_1_SIE		0x08000000
  -#define		MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO_MASK	0x70000000
  -#define		MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO(r)	\
  -			(((r) << 28) & MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO_MASK)
   #define MPIC_GREG_VENDOR_0		0x00040
   #define MPIC_GREG_VENDOR_1		0x00050
   #define MPIC_GREG_VENDOR_2		0x00060

So the question is, should #define MPIC_GREG_GLOBAL_CONF_1 have been also
removed, or could be left as is?

[1] https://lists.ozlabs.org/pipermail/linuxppc-dev/2006-June/023867.html

Arsény

> cheers

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v3 0/4] powerpc: trivial unused functions cleanup
  2015-03-20  4:55       ` Arseny Solokha
@ 2015-03-20  5:39         ` Michael Ellerman
  2015-03-21  6:56           ` Arseny Solokha
  0 siblings, 1 reply; 31+ messages in thread
From: Michael Ellerman @ 2015-03-20  5:39 UTC (permalink / raw)
  To: Arseny Solokha
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Scott Wood, linuxppc-dev,
	linux-kernel

On Fri, 2015-03-20 at 11:55 +0700, Arseny Solokha wrote:
> 
> And by the way, while revisiting the series I've noticed that though the patch
> 4/4 basically reverts [1], it leaves
> 
>   #define MPIC_GREG_GLOBAL_CONF_1		0x00030
> 
> in arch/powerpc/include/asm/mpic.h untouched. That define also loses its uses
> after applying the patch. Compare the following hunk in today's patch w/ the one
> you committed:
> 
>   @@ -33,11 +33,6 @@
>    #define		MPIC_GREG_GCONF_NO_BIAS			0x10000000
>    #define		MPIC_GREG_GCONF_BASE_MASK		0x000fffff
>    #define		MPIC_GREG_GCONF_MCK			0x08000000
>   -#define MPIC_GREG_GLOBAL_CONF_1		0x00030
>   -#define		MPIC_GREG_GLOBAL_CONF_1_SIE		0x08000000
>   -#define		MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO_MASK	0x70000000
>   -#define		MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO(r)	\
>   -			(((r) << 28) & MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO_MASK)
>    #define MPIC_GREG_VENDOR_0		0x00040
>    #define MPIC_GREG_VENDOR_1		0x00050
>    #define MPIC_GREG_VENDOR_2		0x00060
> 
> So the question is, should #define MPIC_GREG_GLOBAL_CONF_1 have been also
> removed, or could be left as is?
> 
> [1] https://lists.ozlabs.org/pipermail/linuxppc-dev/2006-June/023867.html


OK, thanks for the thoroughness.

With #defines like that it's never clear if they should be removed or not. On
the one hand it's not used, so it should be removed. But, it can be useful to
keep the #defines there as documentation.

So I'm 50/50 on it. If you send me a patch to remove it I'll merge it, unless
someone else objects.

cheers



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 2/4] kvm/ppc/mpic: drop unused IRQ_testbit
  2015-03-20  3:56     ` [PATCH 2/4] kvm/ppc/mpic: drop unused IRQ_testbit Arseny Solokha
@ 2015-03-20 11:41       ` Alexander Graf
  2015-03-21  6:56         ` [PATCH v4 " Arseny Solokha
  0 siblings, 1 reply; 31+ messages in thread
From: Alexander Graf @ 2015-03-20 11:41 UTC (permalink / raw)
  To: Arseny Solokha, Benjamin Herrenschmidt
  Cc: Paul Mackerras, Michael Ellerman, Scott Wood, linuxppc-dev,
	linux-kernel, Gleb Natapov, Paolo Bonzini



On 20.03.15 04:56, Arseny Solokha wrote:
> Drop unused static procedure which doesn't have callers within its
> translation unit. It had been already removed independently in QEMU[1]
> from the OpenPIC implementation borrowed from the kernel.

The order was reverse. QEMU's implementation was first and then got
imported into the kernel.

> 
> [1] https://lists.gnu.org/archive/html/qemu-devel/2014-06/msg01812.html
> 
> Signed-off-by: Arseny Solokha <asolokha@kb.kras.ru>
> Cc: Alexander Graf <agraf@suse.de>
> Cc: Gleb Natapov <gleb@kernel.org>
> Cc: Paolo Bonzini <pbonzini@redhat.com>

Please resubmit the patch with CC on kvm@vger and kvm-ppc@vger.


Alex

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH v3 0/4] powerpc: trivial unused functions cleanup
  2015-03-20  5:39         ` Michael Ellerman
@ 2015-03-21  6:56           ` Arseny Solokha
  0 siblings, 0 replies; 31+ messages in thread
From: Arseny Solokha @ 2015-03-21  6:56 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Scott Wood, linuxppc-dev,
	linux-kernel

> On Fri, 2015-03-20 at 11:55 +0700, Arseny Solokha wrote:
>> 
>> And by the way, while revisiting the series I've noticed that though the patch
>> 4/4 basically reverts [1], it leaves
>> 
>>   #define MPIC_GREG_GLOBAL_CONF_1		0x00030
>> 
>> in arch/powerpc/include/asm/mpic.h untouched. That define also loses its uses
>> after applying the patch. Compare the following hunk in today's patch w/ the one
>> you committed:
>> 
>>   @@ -33,11 +33,6 @@
>>    #define		MPIC_GREG_GCONF_NO_BIAS			0x10000000
>>    #define		MPIC_GREG_GCONF_BASE_MASK		0x000fffff
>>    #define		MPIC_GREG_GCONF_MCK			0x08000000
>>   -#define MPIC_GREG_GLOBAL_CONF_1		0x00030
>>   -#define		MPIC_GREG_GLOBAL_CONF_1_SIE		0x08000000
>>   -#define		MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO_MASK	0x70000000
>>   -#define		MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO(r)	\
>>   -			(((r) << 28) & MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO_MASK)
>>    #define MPIC_GREG_VENDOR_0		0x00040
>>    #define MPIC_GREG_VENDOR_1		0x00050
>>    #define MPIC_GREG_VENDOR_2		0x00060
>> 
>> So the question is, should #define MPIC_GREG_GLOBAL_CONF_1 have been also
>> removed, or could be left as is?
>> 
>> [1] https://lists.ozlabs.org/pipermail/linuxppc-dev/2006-June/023867.html
>
>
> OK, thanks for the thoroughness.
>
> With #defines like that it's never clear if they should be removed or not. On
> the one hand it's not used, so it should be removed. But, it can be useful to
> keep the #defines there as documentation.
>
> So I'm 50/50 on it. If you send me a patch to remove it I'll merge it, unless
> someone else objects.

So I'd abstain from removing it, for whatever it may be worth. Let it serve the
documentation purposes.

Arsény

> cheers

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH v4 2/4] kvm/ppc/mpic: drop unused IRQ_testbit
  2015-03-20 11:41       ` Alexander Graf
@ 2015-03-21  6:56         ` Arseny Solokha
  2015-03-21 14:54           ` Alexander Graf
  0 siblings, 1 reply; 31+ messages in thread
From: Arseny Solokha @ 2015-03-21  6:56 UTC (permalink / raw)
  To: Alexander Graf; +Cc: kvm, kvm-ppc, linuxppc-dev, linux-kernel, Arseny Solokha

Drop unused static procedure which doesn't have callers within its
translation unit. It had been already removed independently in QEMU[1]
from the OpenPIC implementation borrowed by the kernel.

[1] https://lists.gnu.org/archive/html/qemu-devel/2014-06/msg01812.html

v4: Fixed the comment regarding the origination of OpenPIC codebase
    and CC'ed KVM mailing lists, as suggested by Alexander Graf.

v3: In patch 4/4, do not remove fsl_mpic_primary_get_version() from
    arch/powerpc/sysdev/mpic.c because the patch by Jia Hongtao
    ("powerpc/85xx: workaround for chips with MSI hardware errata") makes
    use of it.

v2: Added a brief explanation to each patch description of why removed
    functions are unused, as suggested by Michael Ellerman.

Signed-off-by: Arseny Solokha <asolokha@kb.kras.ru>
---
 arch/powerpc/kvm/mpic.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/arch/powerpc/kvm/mpic.c b/arch/powerpc/kvm/mpic.c
index 39b3a8f..a480d99 100644
--- a/arch/powerpc/kvm/mpic.c
+++ b/arch/powerpc/kvm/mpic.c
@@ -289,11 +289,6 @@ static inline void IRQ_resetbit(struct irq_queue *q, int n_IRQ)
 	clear_bit(n_IRQ, q->queue);
 }
 
-static inline int IRQ_testbit(struct irq_queue *q, int n_IRQ)
-{
-	return test_bit(n_IRQ, q->queue);
-}
-
 static void IRQ_check(struct openpic *opp, struct irq_queue *q)
 {
 	int irq = -1;
-- 
2.3.3


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: [PATCH v4 2/4] kvm/ppc/mpic: drop unused IRQ_testbit
  2015-03-21  6:56         ` [PATCH v4 " Arseny Solokha
@ 2015-03-21 14:54           ` Alexander Graf
  0 siblings, 0 replies; 31+ messages in thread
From: Alexander Graf @ 2015-03-21 14:54 UTC (permalink / raw)
  To: Arseny Solokha; +Cc: kvm, kvm-ppc, linuxppc-dev, linux-kernel



On 21.03.15 07:56, Arseny Solokha wrote:
> Drop unused static procedure which doesn't have callers within its
> translation unit. It had been already removed independently in QEMU[1]
> from the OpenPIC implementation borrowed by the kernel.
> 
> [1] https://lists.gnu.org/archive/html/qemu-devel/2014-06/msg01812.html
> 
> v4: Fixed the comment regarding the origination of OpenPIC codebase
>     and CC'ed KVM mailing lists, as suggested by Alexander Graf.
> 
> v3: In patch 4/4, do not remove fsl_mpic_primary_get_version() from
>     arch/powerpc/sysdev/mpic.c because the patch by Jia Hongtao
>     ("powerpc/85xx: workaround for chips with MSI hardware errata") makes
>     use of it.
> 
> v2: Added a brief explanation to each patch description of why removed
>     functions are unused, as suggested by Michael Ellerman.
> 
> Signed-off-by: Arseny Solokha <asolokha@kb.kras.ru>

Thanks, applied to kvm-ppc-queue (for 4.1).


Alex

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2015-03-21 14:54 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-16 10:56 [PATCH 0/4] powerpc: trivial unused functions cleanup Arseny Solokha
2015-02-16 10:56 ` [PATCH 1/4] powerpc/boot: drop planetcore_set_serial_speed Arseny Solokha
2015-02-16 10:56 ` [PATCH 2/4] kvm/ppc/mpic: drop unused IRQ_testbit Arseny Solokha
2015-02-16 10:56 ` [PATCH 3/4] powrepc/qe: drop unused ucc_slow_poll_transmitter_now Arseny Solokha
2015-02-16 10:56 ` [PATCH 4/4] powerpc/mpic: remove unused functions Arseny Solokha
2015-02-19  0:58   ` Michael Ellerman
2015-02-19 12:26     ` Arseny Solokha
2015-02-20  3:34       ` Michael Ellerman
2015-02-20  4:40         ` Arseny Solokha
2015-02-24  4:48           ` Michael Ellerman
2015-02-23 21:31       ` Scott Wood
2015-02-26  2:39         ` Hongtao Jia
2015-02-26  3:27           ` Scott Wood
2015-02-24  9:05 ` [PATCH V2 0/4] powerpc: trivial unused functions cleanup Arseny Solokha
2015-02-24  9:05   ` [PATCH 1/4] powerpc/boot: drop planetcore_set_serial_speed Arseny Solokha
2015-02-24  9:05   ` [PATCH 2/4] kvm/ppc/mpic: drop unused IRQ_testbit Arseny Solokha
2015-02-24  9:05   ` [PATCH 3/4] powrepc/qe: drop unused ucc_slow_poll_transmitter_now Arseny Solokha
2015-02-24  9:05   ` [PATCH 4/4] powerpc/mpic: remove unused functions Arseny Solokha
2015-02-27  2:25     ` Arseny Solokha
2015-03-20  3:56   ` [PATCH v3 0/4] powerpc: trivial unused functions cleanup Arseny Solokha
2015-03-20  3:56     ` [PATCH 1/4] powerpc/boot: drop planetcore_set_serial_speed Arseny Solokha
2015-03-20  3:56     ` [PATCH 2/4] kvm/ppc/mpic: drop unused IRQ_testbit Arseny Solokha
2015-03-20 11:41       ` Alexander Graf
2015-03-21  6:56         ` [PATCH v4 " Arseny Solokha
2015-03-21 14:54           ` Alexander Graf
2015-03-20  3:56     ` [PATCH 3/4] powrepc/qe: drop unused ucc_slow_poll_transmitter_now Arseny Solokha
2015-03-20  3:56     ` [PATCH 4/4] powerpc/mpic: remove unused functions Arseny Solokha
2015-03-20  4:23     ` [PATCH v3 0/4] powerpc: trivial unused functions cleanup Michael Ellerman
2015-03-20  4:55       ` Arseny Solokha
2015-03-20  5:39         ` Michael Ellerman
2015-03-21  6:56           ` Arseny Solokha

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).