[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171214013236.GL17344@builder>
Date: Wed, 13 Dec 2017 17:32:36 -0800
From: Bjorn Andersson <bjorn.andersson@...aro.org>
To: Loic Pallardy <loic.pallardy@...com>
Cc: ohad@...ery.com, linux-remoteproc@...r.kernel.org,
linux-kernel@...r.kernel.org, arnaud.pouliquen@...com,
benjamin.gaignard@...aro.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.
> +{
> + 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
Powered by blists - more mailing lists