Skip to contentSkip to conversation

more cleanups

PATCH In review Stephen Hemminger 3 participants 6 messages Jan 6, 2012 – Jan 9, 2012 1 message not in the archive

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover more cleanups

Just found more places where function tables should be const.

#1 lore raw

PATCH 1/3 usbnet: make ethtool_ops const

The ethtool_ops table of function pointers should be const. Fix all the usb network drivers.

---
Not sure if you want these through net-next or usb-next?

 drivers/net/usb/asix.c       |    2 +-
 drivers/net/usb/cdc_ncm.c    |    4 ++--
 drivers/net/usb/ipheth.c     |    2 +-
 drivers/net/usb/sierra_net.c |    2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)
drivers/net/usb/asix.c +1 -1
@@ -1152,7 +1152,7 @@ static int ax88772_bind(struct usbnet *d
 	return 0;
 }
 
-static struct ethtool_ops ax88178_ethtool_ops = {
+static const struct ethtool_ops ax88178_ethtool_ops = {
 	.get_drvinfo		= asix_get_drvinfo,
 	.get_link		= asix_get_link,
 	.get_msglevel		= usbnet_get_msglevel,
drivers/net/usb/cdc_ncm.c +2 -2
@@ -138,7 +138,7 @@ struct cdc_ncm_ctx {
 static void cdc_ncm_tx_timeout(unsigned long arg);
 static const struct driver_info cdc_ncm_info;
 static struct usb_driver cdc_ncm_driver;
-static struct ethtool_ops cdc_ncm_ethtool_ops;
+static const struct ethtool_ops cdc_ncm_ethtool_ops;
 
 static const struct usb_device_id cdc_devs[] = {
 	{ USB_INTERFACE_INFO(USB_CLASS_COMM,
@@ -1220,7 +1220,7 @@ static struct usb_driver cdc_ncm_driver
 	.supports_autosuspend = 1,
 };
 
-static struct ethtool_ops cdc_ncm_ethtool_ops = {
+static const struct ethtool_ops cdc_ncm_ethtool_ops = {
 	.get_drvinfo = cdc_ncm_get_drvinfo,
 	.get_link = usbnet_get_link,
 	.get_msglevel = usbnet_get_msglevel,
drivers/net/usb/ipheth.c +1 -1
@@ -420,7 +420,7 @@ static u32 ipheth_ethtool_op_get_link(st
 	return netif_carrier_ok(dev->net);
 }
 
-static struct ethtool_ops ops = {
+static const struct ethtool_ops ops = {
 	.get_link = ipheth_ethtool_op_get_link
 };
 
drivers/net/usb/sierra_net.c +1 -1
@@ -618,7 +618,7 @@ static u32 sierra_net_get_link(struct ne
 	return sierra_net_get_private(dev)->link_up && netif_running(net);
 }
 
-static struct ethtool_ops sierra_net_ethtool_ops = {
+static const struct ethtool_ops sierra_net_ethtool_ops = {
 	.get_drvinfo = sierra_net_get_drvinfo,
 	.get_link = sierra_net_get_link,
 	.get_msglevel = usbnet_get_msglevel,

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

Re: [PATCH 1/3] usbnet: make ethtool_ops const

Quoted 5 lines · Stephen Hemminger

The ethtool_ops table of function pointers should be const. Fix all the usb network drivers.

Quoted 8 lines

---
Not sure if you want these through net-next or usb-next?

 drivers/net/usb/asix.c       |    2 +-
 drivers/net/usb/cdc_ncm.c    |    4 ++--
 drivers/net/usb/ipheth.c     |    2 +-
 drivers/net/usb/sierra_net.c |    2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

drivers/net/usb/ patches go through David and net-next, not me.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw

PATCH 2/3 bcm63xx: make ethtool_ops const

In reply to Stephen Hemminger
drivers/net/ethernet/broadcom/bcm63xx_enet.c +1 -1
@@ -1469,7 +1469,7 @@ static int bcm_enet_set_pauseparam(struc
 	return 0;
 }
 
-static struct ethtool_ops bcm_enet_ethtool_ops = {
+static const struct ethtool_ops bcm_enet_ethtool_ops = {
 	.get_strings		= bcm_enet_get_strings,
 	.get_sset_count		= bcm_enet_get_sset_count,
 	.get_ethtool_stats      = bcm_enet_get_ethtool_stats,
#5 lore raw

PATCH 3/3 netdev: make net_device_ops const

In reply to Stephen Hemminger

More drivers where net_device_ops should be const.

---
 drivers/net/ethernet/emulex/benet/be_main.c |    2 +-
 drivers/net/ethernet/tile/tilepro.c         |    3 +--
 3 files changed, 3 insertions(+), 4 deletions(-)
drivers/net/ethernet/emulex/benet/be_main.c +1 -1
@@ -3080,7 +3080,7 @@ fw_exit:
 	return status;
 }
 
-static struct net_device_ops be_netdev_ops = {
+static const struct net_device_ops be_netdev_ops = {
 	.ndo_open		= be_open,
 	.ndo_stop		= be_close,
 	.ndo_start_xmit		= be_xmit,
drivers/net/ethernet/tile/tilepro.c +1 -2
@@ -2260,8 +2260,7 @@ static int tile_net_get_mac(struct net_d
 	return 0;
 }
 
-
-static struct net_device_ops tile_net_ops = {
+static const struct net_device_ops tile_net_ops = {
 	.ndo_open = tile_net_open,
 	.ndo_stop = tile_net_stop,
 	.ndo_start_xmit = tile_net_tx,