[PATCH 1/5] drm/amd/powerplay: Minor fixes in processpptables.c

Ernst Sjöstrand ernstp at gmail.com
Tue Nov 21 15:49:40 UTC 2017


I think my idea here was that if it's not updated later for some
reason we shouldn't silently return success.
But I'm guessing this can't happen with current hardware at least.

Regards
//Ernst

2017-11-21 16:15 GMT+01:00 Alex Deucher <alexdeucher at gmail.com>:
> On Sun, Nov 19, 2017 at 12:52 PM, Ernst Sjöstrand <ernstp at gmail.com> wrote:
>> Reported by smatch:
>> init_overdrive_limits() error: uninitialized symbol 'result'.
>> get_clock_voltage_dependency_table() warn: inconsistent indenting
>>
>> Signed-off-by: Ernst Sjöstrand <ernstp at gmail.com>
>> ---
>>  drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
>> index afae32ee2b0d..7c5b426320f1 100644
>> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
>> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
>> @@ -394,8 +394,8 @@ static int get_clock_voltage_dependency_table(struct pp_hwmgr *hwmgr,
>>                 dep_table->entries[i].clk =
>>                         ((unsigned long)table->entries[i].ucClockHigh << 16) |
>>                         le16_to_cpu(table->entries[i].usClockLow);
>> -                       dep_table->entries[i].v =
>> -                               (unsigned long)le16_to_cpu(table->entries[i].usVoltage);
>> +               dep_table->entries[i].v =
>> +                       (unsigned long)le16_to_cpu(table->entries[i].usVoltage);
>>         }
>>
>>         *ptable = dep_table;
>> @@ -1042,7 +1042,7 @@ static int init_overdrive_limits_V2_1(struct pp_hwmgr *hwmgr,
>>  static int init_overdrive_limits(struct pp_hwmgr *hwmgr,
>>                         const ATOM_PPLIB_POWERPLAYTABLE *powerplay_table)
>>  {
>> -       int result;
>> +       int result = 1;
>
> I think this should probably be initialized to 0.
>
> Alex
>
>>         uint8_t frev, crev;
>>         uint16_t size;
>>
>> --
>> 2.14.1
>>
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list