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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070111093720.GD3141@infradead.org>
Date:	Thu, 11 Jan 2007 09:37:20 +0000
From:	Christoph Hellwig <hch@...radead.org>
To:	Jay Cliburn <jacliburn@...lsouth.net>
Cc:	jeff@...zik.org, shemminger@...l.org, csnook@...hat.com,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
	atl1-devel@...ts.sourceforge.net
Subject: Re: [PATCH 4/4] atl1: Ancillary C files for Attansic L1 driver

> +#define ATL1_STATS_LEN sizeof(atl1_gstrings_stats) / sizeof(struct atl1_stats)

Just use an opencoded ARRAY_SIZE().

> +void atl1_read_pci_cfg(struct atl1_hw *hw, u32 reg, u16 * value)
> +{
> +        struct atl1_adapter *adapter = hw->back;
> +        pci_read_config_word(adapter->pdev, reg, value);
> +}
> +
> +void atl1_write_pci_cfg(struct atl1_hw *hw, u32 reg, u16 * value)
> +{
> +        struct atl1_adapter *adapter = hw->back;
> +        pci_write_config_word(adapter->pdev, reg, *value);
> +}

Please just kill these types of wrappers and use pci_read_config_word/
pci_write_config_word directly.

> +static inline bool atl1_eth_address_valid(u8 * p_addr)
> +{
> +	/* Invalid PermanentAddress ? */
> +	if (((p_addr[0] == 0) &&
> +	     (p_addr[1] == 0) &&
> +	     (p_addr[2] == 0) &&
> +	     (p_addr[3] == 0) && (p_addr[4] == 0) && (p_addr[5] == 0)
> +	    ) || (p_addr[0] & 1)) 
> +		/* Multicast address or Broadcast Address */
> +		return false;
> +
> +	return true;
> +}

Don't we have a generic helper for this kind of thing?

-
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