lkml.org 
[lkml]   [2018]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v2 11/16] remoteproc: introduce rproc_find_carveout_by_name function
Date


> -----Original Message-----
> From: Bjorn Andersson [mailto:bjorn.andersson@linaro.org]
> Sent: Thursday, December 14, 2017 2:33 AM
> To: Loic PALLARDY <loic.pallardy@st.com>
> Cc: ohad@wizery.com; linux-remoteproc@vger.kernel.org; linux-
> kernel@vger.kernel.org; Arnaud POULIQUEN <arnaud.pouliquen@st.com>;
> benjamin.gaignard@linaro.org
> Subject: Re: [PATCH v2 11/16] remoteproc: introduce
> rproc_find_carveout_by_name function
>
> On Thu 30 Nov 08:46 PST 2017, Loic Pallardy wrote:
> > +struct rproc_mem_entry *
> > +rproc_find_carveout_by_name(struct rproc *rproc, char *name)
>
> In almost all cases after this patch you have to do a snprintf(), so it
> would be better to make this function format the name based on a format
> string and variable arguments.

Good point
/Loic
>
> > +{
> > + struct rproc_mem_entry *carveout, *mem = NULL;
> > +
> > + if (!name)
> > + return NULL;
> > +
> > + list_for_each_entry(carveout, &rproc->carveouts, node) {
> > + /* Compare carveout and requested names */
> > + if (!strcmp(carveout->name, name)) {
> > + mem = carveout;
> > + break;
> > + }
> > + }
> > +
> > + return mem;
> > +}
> > +
>
> Regards,
> Bjorn

\
 
 \ /
  Last update: 2018-01-15 10:11    [W:0.089 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site