Commit Msg: Just trying to make the code a bit more readable. We can follow what happens to grc_local_ctrl if we tweak the existing mask rather than setting it from scratch every usage. Signed-off-by: Grant Grundler (grundler@xxxxxxxxxxxxxxxx) While I think I have it right, voice in the back of my head says "don't trust the no_gpio2 assignment change". This diff needs more context than "diff -u" normally provides. Looking at the original change makes this diff a bit more clear: http://lia64.bkbits.net:8080/linux-ia64-test-2.6.11/diffs/drivers/net/tg3.c@xxxxx?nav=index.html|src/|src/drivers|src/drivers/net|hist/drivers/net/tg3.c [ sorry for the oversized URL] thanks, grant ===== drivers/net/tg3.c 1.222 vs edited ===== --- 1.222/drivers/net/tg3.c 2004-11-15 15:53:08 -08:00 +++ edited/drivers/net/tg3.c 2005-01-15 13:44:22 -08:00 @@ -897,8 +897,8 @@ return; /* On 5753 and variants, GPIO2 cannot be used. */ - no_gpio2 = (tp->nic_sram_data_cfg & - NIC_SRAM_DATA_CFG_NO_GPIO2) != 0; + no_gpio2 = tp->nic_sram_data_cfg & + NIC_SRAM_DATA_CFG_NO_GPIO2; grc_local_ctrl = GRC_LCLCTRL_GPIO_OE0 | GRC_LCLCTRL_GPIO_OE1 | @@ -910,29 +910,17 @@ GRC_LCLCTRL_GPIO_OUTPUT2); } tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | - grc_local_ctrl); + grc_local_ctrl); udelay(100); - grc_local_ctrl = GRC_LCLCTRL_GPIO_OE0 | - GRC_LCLCTRL_GPIO_OE1 | - GRC_LCLCTRL_GPIO_OE2 | - GRC_LCLCTRL_GPIO_OUTPUT0 | - GRC_LCLCTRL_GPIO_OUTPUT1 | - GRC_LCLCTRL_GPIO_OUTPUT2; - if (no_gpio2) { - grc_local_ctrl &= ~(GRC_LCLCTRL_GPIO_OE2 | - GRC_LCLCTRL_GPIO_OUTPUT2); - } + grc_local_ctrl |= GRC_LCLCTRL_GPIO_OUTPUT0; + tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | - grc_local_ctrl); + grc_local_ctrl); udelay(100); - grc_local_ctrl = GRC_LCLCTRL_GPIO_OE0 | - GRC_LCLCTRL_GPIO_OE1 | - GRC_LCLCTRL_GPIO_OE2 | - GRC_LCLCTRL_GPIO_OUTPUT0 | - GRC_LCLCTRL_GPIO_OUTPUT1; if (!no_gpio2) { + grc_local_ctrl &= ~GRC_LCLCTRL_GPIO_OUTPUT2; tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | grc_local_ctrl); udelay(100); - : send the line "unsubscribe linux-net" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html