From: Stephen Hemminger <shemminger@osdl.org>
To: "David S. Miller" <davem@redhat.com>, Jeff Garzik <jgarzik@pobox.com>
Cc: scott.feldman@intel.com, netdev@oss.sgi.com
Subject: [PATCH 2.5.70] remove if_port_text
Date: Thu, 29 May 2003 14:28:20 -0700 [thread overview]
Message-ID: <20030529142820.5f657d77.shemminger@osdl.org> (raw)
In-Reply-To: <20030529.140828.78714529.davem@redhat.com>
Eliminate necrophilic code, net-sysfs shouldn't support deprecated if_port.
Since nowhere else is using if_port_text, eliminate it.
diff -Nru a/include/linux/netdevice.h b/include/linux/netdevice.h
--- a/include/linux/netdevice.h Thu May 29 14:24:18 2003
+++ b/include/linux/netdevice.h Thu May 29 14:24:18 2003
@@ -147,8 +147,6 @@
#ifdef __KERNEL__
-extern const char *if_port_text[];
-
#include <linux/cache.h>
#include <linux/skbuff.h>
diff -Nru a/net/core/net-sysfs.c b/net/core/net-sysfs.c
--- a/net/core/net-sysfs.c Thu May 29 14:24:18 2003
+++ b/net/core/net-sysfs.c Thu May 29 14:24:18 2003
@@ -16,16 +16,6 @@
#include <net/sock.h>
#include <linux/rtnetlink.h>
-const char *if_port_text[] = {
- [IF_PORT_UNKNOWN] = "unknown",
- [IF_PORT_10BASE2] = "BNC",
- [IF_PORT_10BASET] = "10baseT",
- [IF_PORT_AUI] = "AUI",
- [IF_PORT_100BASET] = "100baseT",
- [IF_PORT_100BASETX] = "100baseTX",
- [IF_PORT_100BASEFX] = "100baseFX"
-};
-
#define to_net_dev(class) container_of((class), struct net_device, class_dev)
/* generate a show function for simple field */
@@ -66,20 +56,6 @@
NETDEVICE_ATTR(features, "%#x\n");
NETDEVICE_ATTR(type, "%d\n");
-/* TODO: only a few devices set this now should fix others. */
-static ssize_t show_port(struct class_device *dev, char *buf)
-{
- unsigned char port = to_net_dev(dev)->if_port;
- char *cp = buf;
-
- cp += sprintf(cp, "%d", port);
- if (port < ARRAY_SIZE(if_port_text))
- cp += sprintf(cp, " (%s)", if_port_text[port]);
- *cp++ ='\n';
- return cp - buf;
-}
-static CLASS_DEVICE_ATTR(if_port, S_IRUGO, show_port, NULL);
-
static ssize_t format_addr(char *buf, const unsigned char *addr, int len)
{
int i;
@@ -175,7 +151,6 @@
&class_device_attr_features,
&class_device_attr_mtu,
&class_device_attr_flags,
- &class_device_attr_if_port,
&class_device_attr_type,
&class_device_attr_address,
&class_device_attr_broadcast,
diff -Nru a/net/netsyms.c b/net/netsyms.c
--- a/net/netsyms.c Thu May 29 14:24:18 2003
+++ b/net/netsyms.c Thu May 29 14:24:18 2003
@@ -609,8 +609,6 @@
EXPORT_SYMBOL(dev_mc_upload);
EXPORT_SYMBOL(__kill_fasync);
-EXPORT_SYMBOL(if_port_text);
-
#ifdef CONFIG_HIPPI
EXPORT_SYMBOL(hippi_type_trans);
#endif
next prev parent reply other threads:[~2003-05-29 21:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-29 17:41 [PATCH 2.5.70] e100 report link speed via if_port Stephen Hemminger
2003-05-29 20:49 ` Jeff Garzik
2003-05-29 21:08 ` David S. Miller
2003-05-29 21:28 ` Stephen Hemminger [this message]
2003-05-29 21:39 ` [PATCH 2.5.70] remove if_port_text Jeff Garzik
2003-05-29 21:48 ` David S. Miller
2003-05-29 22:07 ` Jeff Garzik
2003-05-30 3:15 ` David S. Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030529142820.5f657d77.shemminger@osdl.org \
--to=shemminger@osdl.org \
--cc=davem@redhat.com \
--cc=jgarzik@pobox.com \
--cc=netdev@oss.sgi.com \
--cc=scott.feldman@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).