lkml.org 
[lkml]   [2018]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 3/5] drivers: base: Introducing software nodes to the firmware node framework
On Tue, Oct 16, 2018 at 03:57:43PM +0300, Andy Shevchenko wrote:
> > +static int property_entry_read_string_array(const struct property_entry *props,
> > + const char *propname,
> > + const char **strings, size_t nval)
> > +{
> > + const struct property_entry *prop;
> > + const void *pointer;
> > + size_t array_len, length;
> > +
> > + /* Find out the array length. */
> > + prop = property_entry_get(props, propname);
> > + if (!prop)
> > + return -EINVAL;
> > +
>
> > + if (!prop->is_array)
> > + /* The array length for a non-array string property is 1. */
> > + array_len = 1;
> > + else
> > + /* Find the length of an array. */
> > + array_len = property_entry_count_elems_of_size(props, propname,
> > + sizeof(const char *));
>
> I understand where it comes from, but here we may use positive condition.

OK.

> > +#define NODE_NAME_MAXSIZE 11
>
> sizeof(int) = 4 (32 bits), so, 32 * 3 / 10 ~= 10. On top are "node" and '\0'.
> Thus, I would rather put 16 here. Or limit the maximum for ida_simple_get().

Let's make it 16.


thanks,

--
heikki

\
 
 \ /
  Last update: 2018-10-16 16:53    [W:0.081 / U:0.648 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site