From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v2 2/7] xen/arm: Implement hip04-d01 platform Date: Tue, 04 Nov 2014 14:03:53 +0000 Message-ID: <5458DCC9.9090406@linaro.org> References: <1415033196-30529-1-git-send-email-frediano.ziglio@huawei.com> <1415033196-30529-3-git-send-email-frediano.ziglio@huawei.com> <5458D2C5.7050900@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Frediano Ziglio , Ian Campbell , Stefano Stabellini , Tim Deegan Cc: Zoltan Kiss , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org 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 :). 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. Regards, -- Julien Grall