lkml.org 
[lkml]   [2023]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v4 4/7] media: qcom: camss: Move VFE power-domain specifics into vfe.c
From
On 18/11/2023 00:32, Konrad Dybcio wrote:
>> + /* count the # of VFEs which have flagged power-domain */
> [...]
>
> Personal peeve, but this comment seems a bit excessive

Well, to me this code "does stuff" that isn't terribly obvious. It took
a while to understand the Gordian knot so its worthwhile documenting it
inline until we can use named pds to make it all go away forever.

>
>> + for (vfepd_num = i = 0; i < camss->vfe_total_num; i++) {
>> + if (res->vfe_res[i].has_pd)
>> + vfepd_num++;
>> + }
>>
>> - camss->genpd_link = devm_kmalloc_array(dev, camss->genpd_num,
>> - sizeof(*camss->genpd_link),
>> - GFP_KERNEL);
>> - if (!camss->genpd_link)
>> - return -ENOMEM;
>> + /*
>> + * If the number of power-domains is greater than the number of VFEs
>> + * then the additional power-domain is for the entire CAMSS block the
>> + * 'top' power-domain.
> the last 3 words seem out of place


>
>> + */
>> + if (camss->genpd_num <= vfepd_num)
>> + return 0;
> if (!(camss->genpd_num > vfepd_num))
>
> would probably be easier to follow given your comment above

Sure, if its easier to read/understand for you, then it is probably so
for others.

I will V5 this.

---
bod

\
 
 \ /
  Last update: 2023-11-20 14:04    [W:0.077 / U:1.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site