Received: with ECARTIS (v1.0.0; list netdev); Thu, 22 May 2003 17:41:48 -0700 (PDT) Received: from fep01-mail.bloor.is.net.cable.rogers.com (fep01-mail.bloor.is.net.cable.rogers.com [66.185.86.71]) by oss.sgi.com (8.12.9/8.12.9) with SMTP id h4N0fB2x008673 for ; Thu, 22 May 2003 17:41:11 -0700 Received: from rogers.com ([24.43.126.4]) by fep01-mail.bloor.is.net.cable.rogers.com (InterMail vM.5.01.05.12 201-253-122-126-112-20020820) with ESMTP id <20030523004049.SQLV518358.fep01-mail.bloor.is.net.cable.rogers.com@rogers.com>; Thu, 22 May 2003 20:40:49 -0400 Message-ID: <3ECD6E2D.5090000@rogers.com> Date: Thu, 22 May 2003 20:41:17 -0400 From: Jeff Muizelaar User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030327 Debian/1.3-4 X-Accept-Language: en MIME-Version: 1.0 To: shemminger@osdl.org CC: netdev@oss.sgi.com Subject: [PATCH] post-sysfs netdev cleanup Content-Type: multipart/mixed; boundary="------------090507050505030501060708" X-Authentication-Info: Submitted using SMTP AUTH PLAIN at fep01-mail.bloor.is.net.cable.rogers.com from [24.43.126.4] using ID at Thu, 22 May 2003 20:40:49 -0400 X-archive-position: 2689 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: muizelaar@rogers.com Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------090507050505030501060708 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit The attached patch removes the struct device from struct net_device and sets net_device.class_dev.dev directly. The class_dev memset is removed because all of struct net_device should already be memset to 0 or there will be other problems. -Jeff --------------090507050505030501060708 Content-Type: text/plain; name="netdev-cleanup.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="netdev-cleanup.patch" diff -urN linux-2.5.69-bk15/include/linux/netdevice.h linux-2.5.69-bk15-netdev-cleanup/include/linux/netdevice.h --- linux-2.5.69-bk15/include/linux/netdevice.h 2003-05-22 20:14:06.000000000 -0400 +++ linux-2.5.69-bk15-netdev-cleanup/include/linux/netdevice.h 2003-05-22 20:15:56.000000000 -0400 @@ -441,9 +441,6 @@ struct divert_blk *divert; #endif /* CONFIG_NET_DIVERT */ - /* generic device structure used in constructing class */ - struct device *dev; - /* class/net/name entry */ struct class_device class_dev; @@ -455,7 +452,7 @@ /* Set the sysfs physical device reference for the network logical device * if set prior to registration will cause a symlink during initialization. */ -#define SET_NETDEV_DEV(net, pdev) ((net)->dev = (pdev)) +#define SET_NETDEV_DEV(net, pdev) ((net)->class_dev.dev = (pdev)) struct packet_type diff -urN linux-2.5.69-bk15/net/core/net-sysfs.c linux-2.5.69-bk15-netdev-cleanup/net/core/net-sysfs.c --- linux-2.5.69-bk15/net/core/net-sysfs.c 2003-05-22 20:14:08.000000000 -0400 +++ linux-2.5.69-bk15-netdev-cleanup/net/core/net-sysfs.c 2003-05-22 20:15:56.000000000 -0400 @@ -291,9 +291,7 @@ struct class_device_attribute *attr; int ret; - memset(class_dev, 0, sizeof(struct class_device)); class_dev->class = &net_class; - class_dev->dev = net->dev; class_dev->class_data = net; snprintf(class_dev->class_id, BUS_ID_SIZE, net->name); --------------090507050505030501060708--