Re: [RFC PATCH 08/12] e1000e: allow bad checksum

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jiri Kosina
Date: Tuesday, September 30, 2008 - 1:38 am

On Mon, 29 Sep 2008, Jesse Brandeburg wrote:


BTW wouldn't something like

	if (e1000_validate_nvm_checksum(hw) >= 0 ||
	    e1000_validate_nvm_checksum(hw) >= 0) {
		/* copy the MAC address out of the NVM */
		if (e1000e_read_mac_addr(&adapter->hw))
		e_err("NVM Read Error reading MAC address\n");
	} else {
		e_err("The NVM Checksum Is Not Valid\n");
		e1000e_dump_eeprom(adapter);
		/*
		 * set MAC address to all zeroes to invalidate and
		 * temporary disable this device for the user. This
		 * blocks regular traffic while still permitting
		 * ethtool ioctls from reaching the hardware as well as
		 * allowing the user to run the interface after
		 * manually setting a hw addr using
		 * `ip link set address`
		 */
		memset(hw->mac.addr, 0, netdev->addr_len);
	}

just be much more readable? Having for(;;) loop which always performs 
three iterations, and having "if" inside that distinguishes two iterations 
from each other just looks peculiar to my eyes :)

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC PATCH 00/12] e1000e debug and protection patches, Jesse Brandeburg, (Mon Sep 29, 8:19 pm)
[RFC PATCH 01/12] x86: export set_memory_ro and set_memory_rw, Jesse Brandeburg, (Mon Sep 29, 8:19 pm)
[RFC PATCH 02/12] On Tue, 23 Sep 2008, David Miller wrote:, Jesse Brandeburg, (Mon Sep 29, 8:19 pm)
[RFC PATCH 05/12] e1000e: fix lockdep issues, Jesse Brandeburg, (Mon Sep 29, 8:19 pm)
[RFC PATCH 06/12] e1000e: drop stats lock, Jesse Brandeburg, (Mon Sep 29, 8:19 pm)
[RFC PATCH 07/12] e1000e: debug contention on NVM SWFLAG, Jesse Brandeburg, (Mon Sep 29, 8:19 pm)
[RFC PATCH 08/12] e1000e: allow bad checksum, Jesse Brandeburg, (Mon Sep 29, 8:19 pm)
[RFC PATCH 09/12] e1000e: dump eeprom to dmesg for ich8/9, Jesse Brandeburg, (Mon Sep 29, 8:20 pm)
[RFC PATCH 12/12] update version, Jesse Brandeburg, (Mon Sep 29, 8:20 pm)
Re: [RFC PATCH 08/12] e1000e: allow bad checksum, Jiri Kosina, (Tue Sep 30, 1:38 am)
RE: [RFC PATCH 07/12] e1000e: debug contention on NVM SWFLAG, Brandeburg, Jesse, (Thu Oct 2, 9:27 am)
RE: [RFC PATCH 07/12] e1000e: debug contention on NVM SWFLAG, Thomas Gleixner, (Thu Oct 2, 11:02 am)
Re: [RFC PATCH 07/12] e1000e: debug contention on NVM SWFLAG, Thomas Gleixner, (Thu Oct 2, 11:58 am)
[PATCH] e1000e: prevent concurrent access to NVRAM, Thomas Gleixner, (Thu Oct 2, 4:42 pm)
Re: [PATCH] e1000e: prevent concurrent access to NVRAM, Jesse Brandeburg, (Thu Oct 2, 5:19 pm)
Re: [PATCH] e1000e: prevent concurrent access to NVRAM, Thomas Gleixner, (Thu Oct 2, 5:28 pm)