netdev
[Top] [All Lists]

Re: [PATCH] Add C99 initializers to ethtool.c

To: Art Haas <ahaas@xxxxxxxxxxx>
Subject: Re: [PATCH] Add C99 initializers to ethtool.c
From: Jeff Garzik <jgarzik@xxxxxxxxx>
Date: Thu, 19 Feb 2004 19:24:54 -0500
Cc: netdev@xxxxxxxxxxx, "David S. Miller" <davem@xxxxxxxxxx>
In-reply-to: <20040219001633.GC9704@artsapartment.org>
References: <20040219001633.GC9704@artsapartment.org>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703
Art Haas wrote:
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;

Since it doesn't warn without -W, I would rather leave it in its more compact form...


        Jeff




<Prev in Thread] Current Thread [Next in Thread>