how to check regmap start address
Tomek The Messenger
tomekthemessenger at gmail.com
Fri Apr 3 08:39:46 EDT 2020
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>
On Thu, Apr 2, 2020 at 2:15 PM Greg KH <greg at kroah.com> wrote:
> On Thu, Apr 02, 2020 at 01:48:23PM +0200, Tomek The Messenger wrote:
> > Hi
> > Let's see how it looks:
> > https://github.com/u-boot/u-boot/blob/master/include/regmap.h
> >
> > I first time ever see such thing like this:
> > struct regmap_range {
> > ulong start;
> > ulong size;
> > };
> > struct regmap {
> > enum regmap_endianness_t endianness;
> > int range_count;
> > struct regmap_range ranges[0];
> > };
> >
> > How I can get access to variable ranges it if is 0 size? Who develops
> this
> > one and who reviewed:)
>
> It is very common and standard C coding style. It happens all the time
> when you have a variable of unknown length at declaration time.
>
> > Anyway If I have pointer to regmap can I check what is start variable in
> > some other way?
>
> What other way do you need to check it?
>
> Why do you think the above code is incorrect? What do you think it
> should look like?
>
> thanks,
>
> greg k-h
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20200403/2ec6db7f/attachment.html>
More information about the Kernelnewbies
mailing list