[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 2/7] xen/arm: Implement hip04-d01 platform



> On 11/04/2014 01:52 PM, Frediano Ziglio wrote:
> >>
> >> [..]
> >>
> >>> +static void __init hip04_iounmap(void __iomem **p) {
> >>> +    if ( *p )
> >>> +    {
> >>> +        iounmap(*p);
> >>> +        *p = NULL;
> >>> +    }
> >>> +}
> >>
> >> What is used for? Should not iounmap enough?
> >>
> >
> > I just like to clear pointers after freeing them.
> 
> It's not really useful :).
> 

Just paranoia :)
Never liked dandling pointers.

> If you really want to keep the *p = NULL. This could be simplify into:
> 
> hip04_iounmap(....)
> {
>    iounmap(*p);
>    *p = NULL;
> }
> 
> This is because iounmap takes care of NULL pointer.
> 

Are you sure? I looked at code and is not a simple vm_free call, it does some 
mapping even if address is NULL.

Regards,
  Frediano


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.