<div dir="ltr">ok, for me strange was this ranges[0] declaration. I found other way to get to know mmio regmap size, just to remember pointer to struct resource* in private data in probe when parsing from device tree reg=<address, size></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 2, 2020 at 2:15 PM Greg KH <<a href="mailto:greg@kroah.com">greg@kroah.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, Apr 02, 2020 at 01:48:23PM +0200, Tomek The Messenger wrote:<br>
> Hi<br>
> Let's see how it looks:<br>
> <a href="https://github.com/u-boot/u-boot/blob/master/include/regmap.h" rel="noreferrer" target="_blank">https://github.com/u-boot/u-boot/blob/master/include/regmap.h</a><br>
> <br>
> I first time ever see such thing like this:<br>
> struct regmap_range {<br>
> ulong start;<br>
> ulong size;<br>
> };<br>
> struct regmap {<br>
> enum regmap_endianness_t endianness;<br>
> int range_count;<br>
> struct regmap_range ranges[0];<br>
> };<br>
> <br>
> How I can get access to variable ranges it if is 0 size? Who develops this<br>
> one and who reviewed:)<br>
<br>
It is very common and standard C coding style.  It happens all the time<br>
when you have a variable of unknown length at declaration time.<br>
<br>
> Anyway If I have pointer to regmap can I check what is start variable in<br>
> some other way?<br>
<br>
What other way do you need to check it?<br>
<br>
Why do you think the above code is incorrect?  What do you think it<br>
should look like?<br>
<br>
thanks,<br>
<br>
greg k-h<br>
</blockquote></div>