netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Art Haas" <ahaas@airmail.net>
To: netdev@oss.sgi.com
Subject: [PATCH] Add C99 initializers to ethtool.c
Date: Wed, 18 Feb 2004 18:16:33 -0600	[thread overview]
Message-ID: <20040219001633.GC9704@artsapartment.org> (raw)

Hi.

Here's a little patch adding C99 initializers to ethtool.c. The patch is
against the current BK, and the file has been recompiled with the
changes successfully.

This patch and the one I just sent for the netfilter file were changed
to make the code easier to read and to remove warnings if a '-W' flag is
added to the compile command.

Art Haas

===== net/core/ethtool.c 1.9 vs edited =====
--- 1.9/net/core/ethtool.c	Sun Oct 12 06:18:38 2003
+++ edited/net/core/ethtool.c	Wed Feb 18 17:22:52 2004
@@ -76,7 +76,7 @@
 
 static int ethtool_get_settings(struct net_device *dev, void *useraddr)
 {
-	struct ethtool_cmd cmd = { ETHTOOL_GSET };
+	struct ethtool_cmd cmd = { .cmd = ETHTOOL_GSET };
 	int err;
 
 	if (!dev->ethtool_ops->get_settings)
@@ -168,7 +168,7 @@
 
 static int ethtool_get_wol(struct net_device *dev, char *useraddr)
 {
-	struct ethtool_wolinfo wol = { ETHTOOL_GWOL };
+	struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL };
 
 	if (!dev->ethtool_ops->get_wol)
 		return -EOPNOTSUPP;
@@ -195,7 +195,7 @@
 
 static int ethtool_get_msglevel(struct net_device *dev, char *useraddr)
 {
-	struct ethtool_value edata = { ETHTOOL_GMSGLVL };
+	struct ethtool_value edata = { .cmd = ETHTOOL_GMSGLVL };
 
 	if (!dev->ethtool_ops->get_msglevel)
 		return -EOPNOTSUPP;
@@ -231,7 +231,7 @@
 
 static int ethtool_get_link(struct net_device *dev, void *useraddr)
 {
-	struct ethtool_value edata = { ETHTOOL_GLINK };
+	struct ethtool_value edata = { .cmd = ETHTOOL_GLINK };
 
 	if (!dev->ethtool_ops->get_link)
 		return -EOPNOTSUPP;
@@ -331,7 +331,7 @@
 
 static int ethtool_get_coalesce(struct net_device *dev, void *useraddr)
 {
-	struct ethtool_coalesce coalesce = { ETHTOOL_GCOALESCE };
+	struct ethtool_coalesce coalesce = { .cmd = ETHTOOL_GCOALESCE };
 
 	if (!dev->ethtool_ops->get_coalesce)
 		return -EOPNOTSUPP;
@@ -358,7 +358,7 @@
 
 static int ethtool_get_ringparam(struct net_device *dev, void *useraddr)
 {
-	struct ethtool_ringparam ringparam = { ETHTOOL_GRINGPARAM };
+	struct ethtool_ringparam ringparam = { .cmd = ETHTOOL_GRINGPARAM };
 
 	if (!dev->ethtool_ops->get_ringparam)
 		return -EOPNOTSUPP;
@@ -385,7 +385,7 @@
 
 static int ethtool_get_pauseparam(struct net_device *dev, void *useraddr)
 {
-	struct ethtool_pauseparam pauseparam = { ETHTOOL_GPAUSEPARAM };
+	struct ethtool_pauseparam pauseparam = { .cmd = ETHTOOL_GPAUSEPARAM };
 
 	if (!dev->ethtool_ops->get_pauseparam)
 		return -EOPNOTSUPP;
@@ -412,7 +412,7 @@
 
 static int ethtool_get_rx_csum(struct net_device *dev, char *useraddr)
 {
-	struct ethtool_value edata = { ETHTOOL_GRXCSUM };
+	struct ethtool_value edata = { .cmd = ETHTOOL_GRXCSUM };
 
 	if (!dev->ethtool_ops->get_rx_csum)
 		return -EOPNOTSUPP;
@@ -440,7 +440,7 @@
 
 static int ethtool_get_tx_csum(struct net_device *dev, char *useraddr)
 {
-	struct ethtool_value edata = { ETHTOOL_GTXCSUM };
+	struct ethtool_value edata = { .cmd = ETHTOOL_GTXCSUM };
 
 	if (!dev->ethtool_ops->get_tx_csum)
 		return -EOPNOTSUPP;
@@ -467,7 +467,7 @@
 
 static int ethtool_get_sg(struct net_device *dev, char *useraddr)
 {
-	struct ethtool_value edata = { ETHTOOL_GSG };
+	struct ethtool_value edata = { .cmd = ETHTOOL_GSG };
 
 	if (!dev->ethtool_ops->get_sg)
 		return -EOPNOTSUPP;
@@ -494,7 +494,7 @@
 
 static int ethtool_get_tso(struct net_device *dev, char *useraddr)
 {
-	struct ethtool_value edata = { ETHTOOL_GTSO };
+	struct ethtool_value edata = { .cmd = ETHTOOL_GTSO };
 
 	if (!dev->ethtool_ops->get_tso)
 		return -EOPNOTSUPP;
-- 
Man once surrendering his reason, has no remaining guard against absurdities
the most monstrous, and like a ship without rudder, is the sport of every wind.

-Thomas Jefferson to James Smith, 1822

             reply	other threads:[~2004-02-19  0:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-19  0:16 Art Haas [this message]
2004-02-20  0:24 ` [PATCH] Add C99 initializers to ethtool.c Jeff Garzik

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=20040219001633.GC9704@artsapartment.org \
    --to=ahaas@airmail.net \
    --cc=netdev@oss.sgi.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).