@@ -382,7 +382,8 @@ supported:
382382 allocate_memory(numFreqDomains * sizeof(${s}_freq_handle_t))
383383 if (${s}DeviceEnumFrequencyDomains(hSysmanDevice, &numFreqDomains, pFreqHandles) == ${X}_RESULT_SUCCESS)
384384 for (index = 0 .. numFreqDomains-1)
385- ${s}_freq_properties_t props
385+ ${s}_freq_properties_t props {};
386+ props.stype = ${S}_STRUCTURE_TYPE_FREQ_PROPERTIES;
386387 if (${s}FrequencyGetProperties(pFreqHandles[index], &props) == ${X}_RESULT_SUCCESS)
387388 # Only change the frequency of the domain if:
388389 # 1. The domain controls a GPU accelerator
@@ -424,7 +425,8 @@ sub-device (notice the additional sub-device check):
424425 allocate_memory(numFreqDomains * sizeof(${s}_freq_handle_t))
425426 if (${s}DeviceEnumFrequencyDomains(hSysmanDevice, &numFreqDomains, pFreqHandles) == ${X}_RESULT_SUCCESS)
426427 for (index = 0 .. numFreqDomains-1)
427- ${s}_freq_properties_t props
428+ ${s}_freq_properties_t props {};
429+ props.stype = ${S}_STRUCTURE_TYPE_FREQ_PROPERTIES;
428430 if (${s}FrequencyGetProperties(pFreqHandles[index], &props) == ${X}_RESULT_SUCCESS)
429431 # Only change the frequency of the domain if:
430432 # 1. The domain controls a GPU accelerator
@@ -597,7 +599,8 @@ The pseudo code below shows how to output the PCI BDF address:
597599.. parsed-literal ::
598600
599601 function ShowPciInfo(${s}_device_handle_t hSysmanDevice)
600- ${s}_pci_properties_t pciProps;
602+ ${s}_pci_properties_t pciProps {};
603+ pciProps.stype = ${S}_STRUCTURE_TYPE_PCI_PROPERTIES;
601604 if (${s}DevicePciGetProperties(hSysmanDevice, &pciProps) == ${X}_RESULT_SUCCESS)
602605 output(" PCI address: %04u:%02u:%02u.%u",
603606 pciProps.address.domain,
@@ -792,7 +795,8 @@ domain on a device:
792795 allocate_memory(numPowerDomains * sizeof(${s}_pwr_handle_t))
793796 if (${s}DeviceEnumPowerDomains(hSysmanDevice, &numPowerDomains, phPower) == ${X}_RESULT_SUCCESS)
794797 for (pwrIndex = 0 .. numPowerDomains-1)
795- ${s}_power_properties_t props
798+ ${s}_power_properties_t props {};
799+ props.stype = ${S}_STRUCTURE_TYPE_POWER_PROPERTIES;
796800 if (${s}PowerGetProperties(phPower[pwrIndex], &props) == ${X}_RESULT_SUCCESS)
797801 if (props.onSubdevice)
798802 output("Sub-device %u power:\n ", props.subdeviceId)
@@ -808,7 +812,7 @@ domain on a device:
808812 function ShowPowerLimits(${s}_pwr_handle_t hPower)
809813 uint32_t limitCount = 0
810814 if (${s}PowerGetLimitsExt(hPower, &limitCount, nullptr) == ${X}_RESULT_SUCCESS)
811- ${s}_power_limit_ext_desc_t * allLimits = allocate(limitCount * sizeof(${s}_power_limit_ext_desc_t))
815+ ${s}_power_limit_ext_desc_t * allLimits = allocate(limitCount * sizeof(${s}_power_limit_ext_desc_t));
812816 if (${s}PowerGetLimitsExt(hPower, &numLimits, allLimits) == ${X}_RESULT_SUCCESS)
813817
814818 for (i = 0; i < limitCount; ++i)
@@ -827,11 +831,12 @@ domain found on a device:
827831 allocate_memory(numPowerDomains * sizeof(${s}_pwr_handle_t))
828832 if (${s}DeviceEnumPowerDomains(hSysmanDevice, &numPowerDomains, phPower) == ${X}_RESULT_SUCCESS)
829833 for (pwrIndex = 0 .. numPowerDomains-1)
830- ${s}_power_properties_t props
834+ ${s}_power_properties_t props {};
835+ props.stype = ${S}_STRUCTURE_TYPE_POWER_PROPERTIES;
831836 if (${s}PowerGetProperties(phPower[pwrIndex], &props) == ${X}_RESULT_SUCCESS)
832837 uint32_t limitCount = 0
833838 if (${s}PowerGetLimitsExt(hPower, &limitCount, nullptr) == ${X}_RESULT_SUCCESS)
834- ${s}_power_limit_ext_desc_t * allLimits = allocate(limitCount * sizeof(${s}_power_limit_ext_desc_t))
839+ ${s}_power_limit_ext_desc_t * allLimits = allocate(limitCount * sizeof(${s}_power_limit_ext_desc_t));
835840 if (${s}PowerGetLimitsExt(hPower, &numLimits, allLimits) == ${X}_RESULT_SUCCESS)
836841 for (i = 0; i < limitCount; ++i)
837842 if (allLimits[i].level == ${S}_POWER_LEVEL_SUSTAINED)
@@ -1586,7 +1591,8 @@ the device and sub-devices:
15861591 free_memory(...)
15871592
15881593 function ShowFabricPortInfo(${s}_fabric_port_handle_t hPort)
1589- ${s}_fabric_port_properties_t props
1594+ ${s}_fabric_port_properties_t props {};
1595+ props.stype = ${S}_STRUCTURE_TYPE_FABRIC_PORT_PROPERTIES;
15901596 if (${s}FabricPortGetProperties(hPort, &props) == ${X}_RESULT_SUCCESS)
15911597 ${s}_fabric_port_state_t state
15921598 if (${s}FabricPortGetState(hPort, &state) == ${X}_RESULT_SUCCESS)
@@ -1826,7 +1832,8 @@ value in RPM, but only if control is permitted:
18261832 speedRequest.speed = SpeedRpm
18271833 speedRequest.speedUnits = ${S}_FAN_SPEED_UNITS_RPM
18281834 for (fanIndex = 0 .. numFans-1)
1829- ${s}_fan_properties_t fanprops
1835+ ${s}_fan_properties_t fanprops {};
1836+ fanprops.stype = ${S}_STRUCTURE_TYPE_FAN_PROPERTIES;
18301837 if (${s}FanGetProperties(phFans[fanIndex], &fanprops) == ${X}_RESULT_SUCCESS)
18311838 if (fanprops.canControl)
18321839 ${s}FanSetFixedSpeedMode(phFans[fanIndex], &speedRequest)
@@ -2024,7 +2031,8 @@ current state of RAS errors:
20242031 allocate_memory(numRasErrorSets * sizeof(${s}_ras_handle_t))
20252032 if (${s}DeviceEnumRasErrorSets(hSysmanDevice, &numRasErrorSets, phRasErrorSets) == ${X}_RESULT_SUCCESS)
20262033 for (rasIndex = 0 .. numRasErrorSets)
2027- ${s}_ras_properties_t props
2034+ ${s}_ras_properties_t props {};
2035+ props.stype = ${S}_STRUCTURE_TYPE_RAS_PROPERTIES;
20282036 if (${s}RasGetProperties(phRasErrorSets[rasIndex], &props) == ${X}_RESULT_SUCCESS)
20292037 var pErrorType
20302038 switch (props.type)
@@ -2146,7 +2154,8 @@ tests in each:
21462154 for (suiteIndex = 0 .. numTestSuites-1)
21472155 uint32_t numTests = 0
21482156 ${s}_diag_test_t* pTests
2149- ${s}_diag_properties_t suiteProps
2157+ ${s}_diag_properties_t suiteProps {};
2158+ suiteProps.stype = ${S}_STRUCTURE_TYPE_DIAG_PROPERTIES;
21502159 if (${s}DiagnosticsGetProperties(phTestSuites[suiteIndex], &suiteProps) != ${X}_RESULT_SUCCESS)
21512160 next_loop(suiteIndex)
21522161 output("Diagnostic test suite %s:", suiteProps.name)
0 commit comments