lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 30 Oct 2007 10:29:27 +0200 (EET)
From:	"Ilpo Järvinen" <ilpo.jarvinen@...sinki.fi>
To:	Florian Fainelli <florian.fainelli@...ecomint.eu>
cc:	netdev@...r.kernel.org
Subject: Re: [PATCH][RFC] Add support for the RDC R6040 Fast Ethernet controller

On Mon, 29 Oct 2007, Florian Fainelli wrote:

> +static int  mdio_read(struct net_device *dev, int phy_id, int location);
> +static void mdio_write(struct net_device *dev, int phy_id, int location, int value);
> +static int r6040_open(struct net_device *dev);
> +static int r6040_start_xmit(struct sk_buff *skb, struct net_device *dev);
> +static irqreturn_t r6040_interrupt(int irq, void *dev_id);
> +static int r6040_close(struct net_device *dev);
> +static void set_multicast_list(struct net_device *dev);
> +static struct ethtool_ops netdev_ethtool_ops;
> +static int r6040_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
> +static void r6040_down(struct net_device *dev);
> +static void r6040_up(struct net_device *dev);
> +static void r6040_tx_timeout(struct net_device *dev);
> +static void r6040_timer(unsigned long);
> +static void r6040_mac_address(struct net_device *dev);
> +
> +static int phy_mode_chk(struct net_device *dev);
> +static int phy_read(int ioaddr, int phy_adr, int reg_idx);
> +static void phy_write(int ioaddr, int phy_adr, int reg_idx, int dat);
> +static void rx_buf_alloc(struct r6040_private *lp, struct net_device *dev);
> +#ifdef CONFIG_R6040_NAPI
> +static int r6040_poll(struct napi_struct *napi, int budget);
> +#endif
> +

...Most of those forward declarations can go if the functions are ordered 
properly. One can trivially notice that the mdio_{read,write} are 
unnecessary already:

> +static int mdio_read(struct net_device *dev, int phy_id, int regnum)
> +{
> +	struct r6040_private *lp = netdev_priv(dev);
> +	long ioaddr = dev->base_addr;
> +	return  (phy_read(ioaddr, lp->phy_addr, regnum)) ;
> +}
> +
> +static void mdio_write(struct net_device *dev, int phy_id, int regnum, int value)
> +{
> +	struct r6040_private *lp = netdev_priv(dev);
> +	long ioaddr = dev->base_addr;
> +
> +	phy_write(ioaddr, lp->phy_addr, regnum, value);
> +}


-- 
 i.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ