Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(E712): fix comparison to True/False #173

Open
wants to merge 1 commit into
base: amd-staging
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions python_smi_tools/rocm_smi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1485,7 +1485,7 @@ def setClocks(deviceList, clktype, clk):
# Validate frequency bitmask
freq = rsmi_frequencies_t()
ret = rocmsmi.rsmi_dev_gpu_clk_freq_get(device, rsmi_clk_names_dict[clktype], byref(freq))
if rsmi_ret_ok(ret, device, 'get_gpu_clk_freq_' + str(clktype)) == False:
if not rsmi_ret_ok(ret, device, 'get_gpu_clk_freq_' + str(clktype)):
RETCODE = 1
return
# The freq_bitmask should be less than 2^(freqs.num_supported)
Expand All @@ -1505,7 +1505,7 @@ def setClocks(deviceList, clktype, clk):
# Validate the bandwidth bitmask
bw = rsmi_pcie_bandwidth_t()
ret = rocmsmi.rsmi_dev_pci_bandwidth_get(device, byref(bw))
if rsmi_ret_ok(ret, device, 'get_PCIe_bandwidth') == False:
if not rsmi_ret_ok(ret, device, 'get_PCIe_bandwidth'):
RETCODE = 1
return
# The freq_bitmask should be less than 2^(bw.transfer_rate.num_supported)
Expand Down Expand Up @@ -1736,7 +1736,7 @@ def setPowerOverDrive(deviceList, value, autoRespond):
new_power_cap.value = int(value) * 1000000

ret = rocmsmi.rsmi_dev_power_cap_range_get(device, 0, byref(power_cap_max), byref(power_cap_min))
if rsmi_ret_ok(ret, device, 'get_power_cap_range') == False:
if not rsmi_ret_ok(ret, device, 'get_power_cap_range'):
printErrLog(device, 'Unable to parse Power OverDrive range')
RETCODE = 1
continue
Expand Down Expand Up @@ -4043,7 +4043,7 @@ def isConciseInfoRequested(args):

if not PRINT_JSON:
print('\n')
if not isConciseInfoRequested(args) and args.showhw == False:
if not isConciseInfoRequested(args) and not args.showhw:
printLogSpacer(headerString)

if args.showallinfo:
Expand Down Expand Up @@ -4296,18 +4296,18 @@ def isConciseInfoRequested(args):
devCsv = ''
sysCsv = ''
# JSON won't have any 'system' data without one of these flags
if args.showdriverversion and args.showallinfo == False:
if args.showdriverversion and not args.showallinfo:
sysCsv = formatCsv(['system'])
print('%s' % (sysCsv))
elif args.showallinfo is True:
elif args.showallinfo:
sysCsv = formatCsv(['system'])
devCsv = formatCsv(deviceList)
print('%s\n%s' % (sysCsv, devCsv))
else:
devCsv = formatCsv(deviceList)
print(devCsv)

if not isConciseInfoRequested(args) and args.showhw == False:
if not isConciseInfoRequested(args) and not args.showhw:
printLogSpacer(footerString)

rsmi_ret_ok(rocmsmi.rsmi_shut_down())
Expand Down
Loading