lkml.org 
[lkml]   [2020]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v6 2/3] drm: Add support for the LogiCVC display controller
Hi Paul,

Just had a casual quick look for custom KMS properties, since new
drivers made that mistake in the past.
Thanks for not including any o/

I made a couple of trivial suggestions - if you agree, feel free to
keep them as follow-up patches.

On Thu, 30 Apr 2020 at 20:28, Paul Kocialkowski
<paul.kocialkowski@bootlin.com> wrote:

> +int logicvc_of_property_parse_u32(struct device_node *of_node,
> + const char *name, u32 *target)
> +{
> + struct logicvc_of_property *property;
> + const char *string;
> + u32 value;
> + int ret;
> +
> + property = logicvc_of_property_lookup(name);
> + if (!property)
> + return -EINVAL;
> +
One could have the logicvc_of_properties[] entries indexed with the
logicvc_of_property_parse_{u32,bool} caller, using that instead of the
name string.

Aside: I suspect the array (as most other arrays in this patch) should
be annotated const, correct?


> + if (property->range[0] || property->range[1])
> + if (value < property->range[0] || value > property->range[1])
Combine the two ifs?

-Emil

\
 
 \ /
  Last update: 2020-05-04 15:31    [W:1.054 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site