summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2015-01-25 23:45:14 +0000
committerStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2015-01-25 23:45:14 +0000
commit3e6b7bb9480ca0aff25f9d6bc7767bf4c5331447 (patch)
tree967316a348ac3ab343a9e02e1ce47c0dd883f576
parent05151b6dcbba16746aa803069dd6046a82e33599 (diff)
downloadast2050-flashrom-3e6b7bb9480ca0aff25f9d6bc7767bf4c5331447.zip
ast2050-flashrom-3e6b7bb9480ca0aff25f9d6bc7767bf4c5331447.tar.gz
Shadowing fix in nicintel_eeprom.c for ancient libpci
Very old versions (<2.2) of pciutils had a typedef named "word" in types.h. That does not play well with previous local variable names of nicintel_eeprom.c. Corresponding to flashrom svn r1874. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
-rw-r--r--nicintel_eeprom.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/nicintel_eeprom.c b/nicintel_eeprom.c
index 7597cca..2d6def1 100644
--- a/nicintel_eeprom.c
+++ b/nicintel_eeprom.c
@@ -103,7 +103,7 @@ static int nicintel_ee_probe(struct flashctx *flash)
return 1;
}
-static int nicintel_ee_read_word(unsigned int addr, uint16_t *word)
+static int nicintel_ee_read_word(unsigned int addr, uint16_t *data)
{
uint32_t tmp = BIT(EERD_START) | (addr << EERD_ADDR);
pci_mmio_writel(tmp, nicintel_eebar + EERD);
@@ -113,7 +113,7 @@ static int nicintel_ee_read_word(unsigned int addr, uint16_t *word)
for (i = 0; i < 10000000; i++) {
tmp = pci_mmio_readl(nicintel_eebar + EERD);
if (tmp & BIT(EERD_DONE)) {
- *word = (tmp >> EERD_DATA) & 0xffff;
+ *data = (tmp >> EERD_DATA) & 0xffff;
return 0;
}
}
@@ -123,26 +123,26 @@ static int nicintel_ee_read_word(unsigned int addr, uint16_t *word)
static int nicintel_ee_read(struct flashctx *flash, uint8_t *buf, unsigned int addr, unsigned int len)
{
- uint16_t word;
+ uint16_t data;
/* The NIC interface always reads 16 b words so we need to convert the address and handle odd address
* explicitly at the start (and also at the end in the loop below). */
if (addr & 1) {
- if (nicintel_ee_read_word(addr / 2, &word))
+ if (nicintel_ee_read_word(addr / 2, &data))
return -1;
- *buf++ = word & 0xff;
+ *buf++ = data & 0xff;
addr++;
len--;
}
while (len > 0) {
- if (nicintel_ee_read_word(addr / 2, &word))
+ if (nicintel_ee_read_word(addr / 2, &data))
return -1;
- *buf++ = word & 0xff;
+ *buf++ = data & 0xff;
addr++;
len--;
if (len > 0) {
- *buf++ = (word >> 8) & 0xff;
+ *buf++ = (data >> 8) & 0xff;
addr++;
len--;
}
OpenPOWER on IntegriCloud