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

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jesse Brandeburg <jesse.brandeburg@...>
Cc: <linux-kernel@...>, <linux-netdev@...>, <kkeil@...>, <agospoda@...>, <arjan@...>, <david.graham@...>, <bruce.w.allan@...>, <jkosina@...>, <john.ronciak@...>, Thomas Gleixner <tglx@...>, <chris.jones@...>, <tim.gardner@...>, <airlied@...>
Date: Tuesday, September 30, 2008 - 4: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, 11:19 pm)
[RFC PATCH 12/12] update version, Jesse Brandeburg, (Mon Sep 29, 11:20 pm)
[RFC PATCH 11/12] e1000e: write protect ICHx NVM to prevent ..., Jesse Brandeburg, (Mon Sep 29, 11:20 pm)
[RFC PATCH 09/12] e1000e: dump eeprom to dmesg for ich8/9, Jesse Brandeburg, (Mon Sep 29, 11:20 pm)
[RFC PATCH 08/12] e1000e: allow bad checksum, Jesse Brandeburg, (Mon Sep 29, 11:19 pm)
Re: [RFC PATCH 08/12] e1000e: allow bad checksum, Jiri Kosina, (Tue Sep 30, 4:38 am)
[RFC PATCH 10/12] e1000e: Use set_memory_ro()/set_memory_rw(..., Jesse Brandeburg, (Mon Sep 29, 11:20 pm)
[RFC PATCH 07/12] e1000e: debug contention on NVM SWFLAG, Jesse Brandeburg, (Mon Sep 29, 11:19 pm)
[PATCH] e1000e: prevent concurrent access to NVRAM, Thomas Gleixner, (Thu Oct 2, 7:42 pm)
Re: [PATCH] e1000e: prevent concurrent access to NVRAM, Jesse Brandeburg, (Thu Oct 2, 8:19 pm)
Re: [PATCH] e1000e: prevent concurrent access to NVRAM, Thomas Gleixner, (Thu Oct 2, 8:28 pm)
RE: [RFC PATCH 07/12] e1000e: debug contention on NVM SWFLAG, Brandeburg, Jesse, (Thu Oct 2, 12:27 pm)
[RFC PATCH 06/12] e1000e: drop stats lock, Jesse Brandeburg, (Mon Sep 29, 11:19 pm)
[RFC PATCH 05/12] e1000e: fix lockdep issues, Jesse Brandeburg, (Mon Sep 29, 11:19 pm)
[RFC PATCH 04/12] e1000e: do not ever sleep in interrupt con..., Jesse Brandeburg, (Mon Sep 29, 11:19 pm)
[RFC PATCH 03/12] e1000e: reset swflag after resetting hardw..., Jesse Brandeburg, (Mon Sep 29, 11:19 pm)
[RFC PATCH 01/12] x86: export set_memory_ro and set_memory_rw, Jesse Brandeburg, (Mon Sep 29, 11:19 pm)
[RFC PATCH 02/12] On Tue, 23 Sep 2008, David Miller wrote:, Jesse Brandeburg, (Mon Sep 29, 11:19 pm)