From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751554AbdLNAgs (ORCPT ); Wed, 13 Dec 2017 19:36:48 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:34125 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750737AbdLNAgp (ORCPT ); Wed, 13 Dec 2017 19:36:45 -0500 X-Google-Smtp-Source: ACJfBosLIdDinnzQS/qZMd38HH3Pcu9Iul+3xEtW3iN1i6lk06j3Nxwe4TVUeZ1Xni69C6G32TE/tQ== Date: Wed, 13 Dec 2017 16:36:41 -0800 From: Bjorn Andersson To: Loic Pallardy Cc: ohad@wizery.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, arnaud.pouliquen@st.com, benjamin.gaignard@linaro.org Subject: Re: [PATCH v2 03/16] remoteproc: introduce rproc_add_carveout function Message-ID: <20171214003641.GE17344@builder> References: <1512060411-729-1-git-send-email-loic.pallardy@st.com> <1512060411-729-4-git-send-email-loic.pallardy@st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1512060411-729-4-git-send-email-loic.pallardy@st.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 30 Nov 08:46 PST 2017, Loic Pallardy wrote: > diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c > index f23daf9..279320a 100644 > --- a/drivers/remoteproc/remoteproc_core.c > +++ b/drivers/remoteproc/remoteproc_core.c > @@ -737,6 +737,7 @@ static int rproc_handle_carveout(struct rproc *rproc, > carveout->dma = dma; > carveout->da = rsc->da; > carveout->release = rproc_release_carveout; > + carveout->priv = (void *)CARVEOUT_RSC_ALLOCATED; I don't fancy the (ab)use of priv to keep track of this, I also don't see that it's ever used. Please drop it. [..] > +int rproc_add_carveout(struct rproc *rproc, struct rproc_mem_entry *mem) > +{ > + if (!rproc || !mem) > + return -EINVAL; I don't see this function doing more than adding the item to the list of carveouts, which can't fail. So let's just rely on the user calling it with valid references and make it return void. > + > + mem->priv = (void *)CARVEOUT_EXTERNAL; > + > + list_add_tail(&mem->node, &rproc->carveouts); > + > + return 0; > +} > +EXPORT_SYMBOL(rproc_add_carveout); Regards, Bjorn