From: Mark Einon <mark.einon@gmail.com>
To: gregkh@linuxfoundation.org
Cc: devel@driverdev.osuosl.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, Mark Einon <mark.einon@gmail.com>
Subject: [PATCH 5/8] staging: et131x: Remove unnecessary i2c_wack variable
Date: Wed, 20 Aug 2014 23:17:55 +0100 [thread overview]
Message-ID: <1408573078-9320-6-git-send-email-mark.einon@gmail.com> (raw)
In-Reply-To: <1408573078-9320-1-git-send-email-mark.einon@gmail.com>
i2c_wack is only used to implement a while(1) loop, so let's remove it.
Signed-off-by: Mark Einon <mark.einon@gmail.com>
---
drivers/staging/et131x/et131x.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c
index fc18e8d..551b250 100644
--- a/drivers/staging/et131x/et131x.c
+++ b/drivers/staging/et131x/et131x.c
@@ -573,7 +573,6 @@ static int eeprom_write(struct et131x_adapter *adapter, u32 addr, u8 data)
int index = 0;
int retries;
int err = 0;
- int i2c_wack = 0;
int writeok = 0;
u32 status;
u32 val = 0;
@@ -599,8 +598,6 @@ static int eeprom_write(struct et131x_adapter *adapter, u32 addr, u8 data)
LBCIF_CONTROL_LBCIF_ENABLE | LBCIF_CONTROL_I2C_WRITE))
return -EIO;
- i2c_wack = 1;
-
/* Prepare EEPROM address for Step 3 */
for (retries = 0; retries < MAX_NUM_WRITE_RETRIES; retries++) {
@@ -656,9 +653,9 @@ static int eeprom_write(struct et131x_adapter *adapter, u32 addr, u8 data)
*/
udelay(10);
- while (i2c_wack) {
+ while (1) {
if (pci_write_config_byte(pdev, LBCIF_CONTROL_REGISTER,
- LBCIF_CONTROL_LBCIF_ENABLE))
+ LBCIF_CONTROL_LBCIF_ENABLE))
writeok = 0;
/* Do read until internal ACK_ERROR goes away meaning write
@@ -670,7 +667,8 @@ static int eeprom_write(struct et131x_adapter *adapter, u32 addr, u8 data)
addr);
do {
pci_read_config_dword(pdev,
- LBCIF_DATA_REGISTER, &val);
+ LBCIF_DATA_REGISTER,
+ &val);
} while ((val & 0x00010000) == 0);
} while (val & 0x00040000);
--
2.1.0
next prev parent reply other threads:[~2014-08-20 22:17 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-20 22:17 [PATCH 0/8] Implement NAPI in et131x Mark Einon
2014-08-20 22:17 ` [PATCH 1/8] staging: et131x: Use eth_mac_addr() instead of duplicating the functionality Mark Einon
2014-08-20 22:17 ` [PATCH 2/8] staging: et131x: Don't handle rx/tx packets when changing mtu Mark Einon
2014-08-20 22:17 ` [PATCH 3/8] staging: et131x: Use for loop to initialise contiguous registers to zero Mark Einon
2014-08-30 20:32 ` Greg KH
2014-08-31 14:25 ` Mark Einon
2014-08-31 16:11 ` Greg KH
2014-08-20 22:17 ` [PATCH 4/8] staging: et131x: Use for loop to initialise contiguous macstat " Mark Einon
2014-08-21 8:40 ` David Laight
2014-08-21 10:05 ` Mark Einon
2014-08-20 22:17 ` Mark Einon [this message]
2014-08-20 22:22 ` [PATCH 5/8] staging: et131x: Remove unnecessary i2c_wack variable Fabio Estevam
2014-08-21 9:18 ` Mark Einon
2014-08-21 12:06 ` Fabio Estevam
2014-08-21 14:59 ` Mark Einon
2014-08-20 22:17 ` [PATCH 6/8] staging: et131x: Rename NUM_PACKETS_HANDLED to MAX_PACKETS_HANDLED Mark Einon
2014-08-20 22:17 ` [PATCH 7/8] staging: et131x: Fix ET_INTR_TXDMA_ISR register name typo Mark Einon
2014-08-20 22:17 ` [PATCH 8/8] staging: et131x: Implement NAPI support Mark Einon
2014-08-21 3:25 ` Stephen Hemminger
2014-08-21 9:23 ` Mark Einon
2014-08-21 3:25 ` Stephen Hemminger
2014-08-21 9:25 ` Mark Einon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1408573078-9320-6-git-send-email-mark.einon@gmail.com \
--to=mark.einon@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).