trying bug fix for corner case capacity issue

This commit is contained in:
inxi-svn 2014-08-14 05:10:52 +00:00
parent 2709f5120b
commit 8da1e3bfd8

16
inxi
View file

@ -3,7 +3,7 @@
#### Script Name: inxi
#### Version: 2.1.95
#### Date: 2014-08-13
#### Patch Number: 01
#### Patch Number: 02
########################################################################
#### SPECIAL THANKS
########################################################################
@ -8143,6 +8143,7 @@ get_ram_data()
location=""
locator=""
aDerivedModuleSize[0]=0
aFoundModules[0]=0
aMaxCapacity[0]=0
aMaxModuleSize[0]=0
moduleVoltage=""
@ -8227,7 +8228,6 @@ get_ram_data()
a_memory[i,7]=aMaxModuleSize[k]
a_memory[i,8]=moduleVoltage
# print primaryType "," arrayHandle "," location "," maxCapacity "," numberOfDevices "," use "," errorCorrection "," maxModuleSize "," moduleVoltage
# reset
primaryType=""
arrayHandle=""
@ -8241,6 +8241,7 @@ get_ram_data()
aMaxCapacity[k]=0
aMaxModuleSize[k]=0
aDerivedModuleSize[k]=0
aFoundModules[k]=0
}
/^Handle .* DMI type 17/ {
primaryType="memory-device"
@ -8257,6 +8258,9 @@ get_ram_data()
if ( $1 == "Size") {
# do not try to guess from installed modules, only use this to correct type 5 data
aDerivedModuleSize[k-1]=calculateSize($2,aDerivedModuleSize[k-1])
if ( aDerivedModuleSize[k-1] ~ /^[0-9]+$/ ){
aFoundModules[k-1]++
}
#print aDerivedModuleSize[k-1] " dm:"k":mm " aMaxModuleSize[k-1]
deviceSize=$2
}
@ -8323,7 +8327,6 @@ get_ram_data()
dataWidth=totalWidth
totalWidth=tempWidth
}
# print primaryType "," arrayHandle "," deviceSize "," bankLocator "," locator "," formFactor "," deviceType "," deviceTypeDetail "," deviceSpeed "," configuredClockSpeed "," dataWidth "," totalWidth "," deviceManufacturer "," devicePartNumber "," deviceSerialNumber "," mainLocator
a_memory[i,0]=primaryType
a_memory[i,1]=arrayHandle
a_memory[i,2]=deviceSize
@ -8387,9 +8390,10 @@ get_ram_data()
if (aMaxModuleSize[m] != "") {
aMaxModuleSize[m]=int(aMaxModuleSize[m])
}
if (a_memory[j,3] != "" && a_memory[j,4] != "" ) {
if ( a_memory[j,3] < ( a_memory[j,4] * aDerivedModuleSize[m] ) ) {
a_memory[j,3] = a_memory[j,4] * aDerivedModuleSize[m]
# note: some cases memory capacity == max module size, so one stick will fill it
if (a_memory[j,3] != "" && aFoundModules[m] != 0 ) {
if ( a_memory[j,3] < aDerivedModuleSize[m] * aFoundModules[m] ) {
a_memory[j,3] = aDerivedModuleSize[m] * aFoundModules[m]
estCap=" (est)"
}
}