diff options
author | Francis Rowe <info@gluglug.org.uk> | 2015-01-11 04:18:23 +0000 |
---|---|---|
committer | Francis Rowe <info@gluglug.org.uk> | 2015-01-11 04:18:23 +0000 |
commit | 6946ae4d032742b04445ae7ad7804970dbaaa7a8 (patch) | |
tree | e1dea42d6714825a39a99e89406f4eb5bde2b01a /resources/utilities/ich9deblob/src | |
parent | 293d52e0d125f56b106a10284c60e7cd22605f27 (diff) | |
download | librebootfr-6946ae4d032742b04445ae7ad7804970dbaaa7a8.tar.gz librebootfr-6946ae4d032742b04445ae7ad7804970dbaaa7a8.zip |
ich9deblob: remove useless variable in main function
Diffstat (limited to 'resources/utilities/ich9deblob/src')
-rw-r--r-- | resources/utilities/ich9deblob/src/ich9gen.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/resources/utilities/ich9deblob/src/ich9gen.c b/resources/utilities/ich9deblob/src/ich9gen.c index 998dcf23..d07c5500 100644 --- a/resources/utilities/ich9deblob/src/ich9gen.c +++ b/resources/utilities/ich9deblob/src/ich9gen.c @@ -23,7 +23,6 @@ int main(int argc, char *argv[]) { int i, j; - uint8_t customMacAddress[6]; /* Only set/used if the user wants to */ struct GBEREGIONRECORD_8K gbeStruct8k = generatedGbeStruct8k(); struct DESCRIPTORREGIONRECORD descriptorStruct4M = generatedDescriptorStructRom4M(); @@ -69,24 +68,23 @@ int main(int argc, char *argv[]) } } for(i=0; i<6; i++) { - customMacAddress[i] = 0; + gbeStruct8k.main.macAddress[i] = 0; /* Go through each nibble of the byte */ for(j=0; j<2; j++) { if(argv[2][(i*3)+j]>='a' && argv[2][(i*3)+j]<='f') - customMacAddress[i] |= (uint8_t)((argv[2][(i*3)+j] - 87) << ((j^1) << 2)); + gbeStruct8k.main.macAddress[i] |= (uint8_t)((argv[2][(i*3)+j] - 87) << ((j^1) << 2)); else if(argv[2][(i*3)+j]>='A' && argv[2][(i*3)+j]<='F') - customMacAddress[i] |= (uint8_t)((argv[2][(i*3)+j] - 55) << ((j^1) << 2)); + gbeStruct8k.main.macAddress[i] |= (uint8_t)((argv[2][(i*3)+j] - 55) << ((j^1) << 2)); else if(argv[2][(i*3)+j]>='0' && argv[2][(i*3)+j]<='9') - customMacAddress[i] |= (uint8_t)((argv[2][(i*3)+j] - 48) << ((j^1) << 2)); + gbeStruct8k.main.macAddress[i] |= (uint8_t)((argv[2][(i*3)+j] - 48) << ((j^1) << 2)); else { printf("ich9gen: invalid mac address format (non-hex characters)\n"); return 1; } } } - /* Now that the new MAC address is verified, use it */ - memcpy(&gbeStruct8k.main.macAddress, &customMacAddress, 6); /* Update MAC address in main Gbe */ + gbeStruct8k.main.checkSum = gbeGetChecksumFrom4kStruct(gbeStruct8k.main, GBECHECKSUMTOTAL); /* Fix the checksum */ memcpy(&gbeStruct8k.backup, &gbeStruct8k.main, GBEREGIONSIZE_4K); /* Copy to the backup */ |