[2.6.19 PATCH 4/7] ehea: ethtool interface

Thomas Klein osstklei at de.ibm.com
Mon Aug 21 20:53:26 EST 2006


Alexey Dobriyan wrote:
 > On Fri, Aug 18, 2006 at 01:33:22PM +0200, Jan-Bernd Themann wrote:
 >> --- linux-2.6.18-rc4-orig/drivers/net/ehea/ehea_ethtool.c
 >> +++ kernel/drivers/net/ehea/ehea_ethtool.c
 >> +{
 >> +    strncpy(info->driver, DRV_NAME, sizeof(info->driver) - 1);
 >> +    strncpy(info->version, DRV_VERSION, sizeof(info->version) - 1);
 >
 > Use strlcpy() to not forget -1 accidently.

Done.

 >
 >> +static u32 netdev_get_msglevel(struct net_device *dev)
 >                        ^^^^^^^^
 >> +{
 >> +    struct ehea_port *port = netdev_priv(dev);
 >> +    return port->msg_enable;
 >                        ^^^^^^
 >
 > Something is mis-named here.

The kernel requires a structure member of that name.

 >> +struct ethtool_ops ehea_ethtool_ops = {
 >> +    .get_settings = netdev_get_settings,
 >> +    .get_drvinfo = netdev_get_drvinfo,
 >> +    .get_msglevel = netdev_get_msglevel,
 >> +    .set_msglevel = netdev_set_msglevel,
 >> +        .get_link = ethtool_op_get_link,
 >> +        .get_tx_csum = ethtool_op_get_tx_csum,
 >
 > Whitespace breakage.

Fixed.

 >> +    .set_settings = NULL,
 >> +    .nway_reset = NULL,
 >> +    .get_pauseparam = NULL,
 >> +    .set_pauseparam = NULL,
 >> +    .get_rx_csum = NULL,
 >> +    .set_rx_csum = NULL,
 >> +    .phys_id = NULL,
 >> +    .self_test = NULL,
 >> +    .self_test_count = NULL
 >
 > If you don't use them, don't mention them at all. Compiler will DTRT.

Agreed. Assignments removed.

Thanks again :-)
Thomas





More information about the Linuxppc-dev mailing list