Hei Sakari,

On 04/30/2017 01:21 AM, Sakari Ailus wrote:
> Hi, Stan!!
> 
> On Fri, Apr 28, 2017 at 12:13:52PM +0300, Stanimir Varbanov wrote:
> ...
>> +int helper_get_bufreq(struct venus_inst *inst, u32 type,
>> +                  struct hfi_buffer_requirements *req)
>> +{
>> +    u32 ptype = HFI_PROPERTY_CONFIG_BUFFER_REQUIREMENTS;
>> +    union hfi_get_property hprop;
>> +    int ret, i;
> 
> unsigned int i ? It's an array index...

Thanks for pointing that out, I have to revisit all similar places as
well ...

> 
>> +
>> +    if (req)
>> +            memset(req, 0, sizeof(*req));
>> +
>> +    ret = hfi_session_get_property(inst, ptype, &hprop);
>> +    if (ret)
>> +            return ret;
>> +
>> +    ret = -EINVAL;
>> +
>> +    for (i = 0; i < HFI_BUFFER_TYPE_MAX; i++) {
>> +            if (hprop.bufreq[i].type != type)
>> +                    continue;
>> +
>> +            if (req)
>> +                    memcpy(req, &hprop.bufreq[i], sizeof(*req));
>> +            ret = 0;
>> +            break;
>> +    }
>> +
>> +    return ret;
>> +}
>> +EXPORT_SYMBOL_GPL(helper_get_bufreq);
> 
> As these are global symbols but still specific to a single driver, it'd be
> good to have them prefixed with a common prefix. How about "venus"? You
> actually already have that in a macro in the header. :-)

You are damned right, will rework that in next version.

<snip>

-- 
regards,
Stan

Reply via email to