Skip to content

Commit

Permalink
net: ibm: emac: remove unused sysrq handler for 'c' key
Browse files Browse the repository at this point in the history
Since commit d6580a9 ("kexec: sysrq: simplify sysrq-c handler"),
the sysrq handler for the 'c' key has been sysrq_crash_op.  Debugging
code in the ibm_emac driver also tries to register a handler for the 'c'
key, but this has no effect because register_sysrq_key() doesn't replace
existing handlers.  Since evidently no one has cared enough to fix this
in the last 8 years, and it's very rare for drivers to register sysrq
handlers (for good reason), just remove the dead code.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Biggers authored and David S. Miller committed Apr 5, 2017
1 parent 3f3c278 commit 5e35141
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 306 deletions.
1 change: 0 additions & 1 deletion drivers/net/ethernet/ibm/emac/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ ibm_emac-y := mal.o core.o phy.o
ibm_emac-$(CONFIG_IBM_EMAC_ZMII) += zmii.o
ibm_emac-$(CONFIG_IBM_EMAC_RGMII) += rgmii.o
ibm_emac-$(CONFIG_IBM_EMAC_TAH) += tah.o
ibm_emac-$(CONFIG_IBM_EMAC_DEBUG) += debug.o
7 changes: 0 additions & 7 deletions drivers/net/ethernet/ibm/emac/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3173,8 +3173,6 @@ static int emac_probe(struct platform_device *ofdev)
printk("%s: found %s PHY (0x%02x)\n", ndev->name,
dev->phy.def->name, dev->phy.address);

emac_dbg_register(dev);

/* Life is good */
return 0;

Expand Down Expand Up @@ -3243,7 +3241,6 @@ static int emac_remove(struct platform_device *ofdev)
mal_unregister_commac(dev->mal, &dev->commac);
emac_put_deps(dev);

emac_dbg_unregister(dev);
iounmap(dev->emacp);

if (dev->wol_irq)
Expand Down Expand Up @@ -3326,9 +3323,6 @@ static int __init emac_init(void)

printk(KERN_INFO DRV_DESC ", version " DRV_VERSION "\n");

/* Init debug stuff */
emac_init_debug();

/* Build EMAC boot list */
emac_make_bootlist();

Expand Down Expand Up @@ -3373,7 +3367,6 @@ static void __exit emac_exit(void)
rgmii_exit();
zmii_exit();
mal_exit();
emac_fini_debug();

/* Destroy EMAC boot list */
for (i = 0; i < EMAC_BOOT_LIST_SIZE; i++)
Expand Down
270 changes: 0 additions & 270 deletions drivers/net/ethernet/ibm/emac/debug.c

This file was deleted.

23 changes: 0 additions & 23 deletions drivers/net/ethernet/ibm/emac/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,9 @@
#include "core.h"

#if defined(CONFIG_IBM_EMAC_DEBUG)

struct emac_instance;
struct mal_instance;

void emac_dbg_register(struct emac_instance *dev);
void emac_dbg_unregister(struct emac_instance *dev);
void mal_dbg_register(struct mal_instance *mal);
void mal_dbg_unregister(struct mal_instance *mal);
int emac_init_debug(void) __init;
void emac_fini_debug(void) __exit;
void emac_dbg_dump_all(void);

# define DBG_LEVEL 1

#else

# define emac_dbg_register(x) do { } while(0)
# define emac_dbg_unregister(x) do { } while(0)
# define mal_dbg_register(x) do { } while(0)
# define mal_dbg_unregister(x) do { } while(0)
# define emac_init_debug() do { } while(0)
# define emac_fini_debug() do { } while(0)
# define emac_dbg_dump_all() do { } while(0)

# define DBG_LEVEL 0

#endif

#define EMAC_DBG(d, name, fmt, arg...) \
Expand Down
4 changes: 0 additions & 4 deletions drivers/net/ethernet/ibm/emac/mal.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,8 +695,6 @@ static int mal_probe(struct platform_device *ofdev)
wmb();
platform_set_drvdata(ofdev, mal);

mal_dbg_register(mal);

return 0;

fail6:
Expand Down Expand Up @@ -740,8 +738,6 @@ static int mal_remove(struct platform_device *ofdev)

mal_reset(mal);

mal_dbg_unregister(mal);

dma_free_coherent(&ofdev->dev,
sizeof(struct mal_descriptor) *
(NUM_TX_BUFF * mal->num_tx_chans +
Expand Down
2 changes: 1 addition & 1 deletion drivers/tty/sysrq.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ static struct sysrq_key_op *sysrq_key_table[36] = {
*/
NULL, /* a */
&sysrq_reboot_op, /* b */
&sysrq_crash_op, /* c & ibm_emac driver debug */
&sysrq_crash_op, /* c */
&sysrq_showlocks_op, /* d */
&sysrq_term_op, /* e */
&sysrq_moom_op, /* f */
Expand Down

0 comments on commit 5e35141

Please sign in to comment.