From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933048AbeAOJKP convert rfc822-to-8bit (ORCPT + 1 other); Mon, 15 Jan 2018 04:10:15 -0500 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:43990 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932629AbeAOJKK (ORCPT ); Mon, 15 Jan 2018 04:10:10 -0500 From: Loic PALLARDY To: Bjorn Andersson CC: "ohad@wizery.com" , "linux-remoteproc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Arnaud POULIQUEN , "benjamin.gaignard@linaro.org" Subject: RE: [PATCH v2 11/16] remoteproc: introduce rproc_find_carveout_by_name function Thread-Topic: [PATCH v2 11/16] remoteproc: introduce rproc_find_carveout_by_name function Thread-Index: AQHTafrivGM5zuhpRkK9jytcM2sgX6NCEh4AgDLbIQA= Date: Mon, 15 Jan 2018 09:10:06 +0000 Message-ID: <9a77f950ed504e27a7e8a13ec29182cb@SFHDAG7NODE2.st.com> References: <1512060411-729-1-git-send-email-loic.pallardy@st.com> <1512060411-729-12-git-send-email-loic.pallardy@st.com> <20171214013236.GL17344@builder> In-Reply-To: <20171214013236.GL17344@builder> Accept-Language: fr-FR, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.75.127.45] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-15_05:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: > -----Original Message----- > From: Bjorn Andersson [mailto:bjorn.andersson@linaro.org] > Sent: Thursday, December 14, 2017 2:33 AM > To: Loic PALLARDY > Cc: ohad@wizery.com; linux-remoteproc@vger.kernel.org; linux- > kernel@vger.kernel.org; Arnaud POULIQUEN ; > 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