Skip to contentSkip to conversation

drm/amd/powerplay: enable dpm for baffin.

DISCUSSION Dan Carpenter 2 participants 2 messages May 9, 2016 – May 10, 2016

lore
Share & tools
lore
#0 lore raw

Hello Rex Zhu,

This is a semi-automatic email about new static checker warnings.

The patch a23eefa2f461: "drm/amd/powerplay: enable dpm for baffin." from Nov 19, 2015, leads to the following Smatch complaint:

drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/polaris10_hwmgr.c:206 phm_apply_dal_min_voltage_request()
error: we previously assumed 'table' could be null (see line 202)

drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/polaris10_hwmgr.c
201
202 if (!table && !(dal_power_level >= PP_DAL_POWERLEVEL_ULTRALOW &&

                           ^^

Should this be an ||?

203 dal_power_level <= PP_DAL_POWERLEVEL_PERFORMANCE))
204 return;
205

   206		for (i = 0; i < table->count; i++) {
                                ^^^^^^^^^^^^

Because if table is ever NULL then we're toasted on the next line.

   207			if (dal_power_level == table->entries[i].clk) {
   208				req_vddc = table->entries[i].v;

regards,
dan carpenter
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw

It is a bug. I will fix it.

Best Regars
Rex

-----Original Message-----
From: Dan Carpenter [mailto:[email protected]]
Sent: Tuesday, May 10, 2016 3:42 AM
To: Zhu, Rex
Cc: [email protected]
Subject: re: drm/amd/powerplay: enable dpm for baffin.

Hello Rex Zhu,

This is a semi-automatic email about new static checker warnings.

The patch a23eefa2f461: "drm/amd/powerplay: enable dpm for baffin." from Nov 19, 2015, leads to the following Smatch complaint:

drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/polaris10_hwmgr.c:206 phm_apply_dal_min_voltage_request()
error: we previously assumed 'table' could be null (see line 202)

drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/polaris10_hwmgr.c
201
202 if (!table && !(dal_power_level >= PP_DAL_POWERLEVEL_ULTRALOW &&

                           ^^

Should this be an ||?

203 dal_power_level <= PP_DAL_POWERLEVEL_PERFORMANCE))
204 return;
205
206 for (i = 0; i < table->count; i++) {
^^^^^^^^^^^^ Because if table is ever NULL then we're toasted on the next line.

   207			if (dal_power_level == table->entries[i].clk) {
   208				req_vddc = table->entries[i].v;

regards,
dan carpenter
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel