From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752522AbdLNFfB (ORCPT ); Thu, 14 Dec 2017 00:35:01 -0500 Received: from mail-pf0-f175.google.com ([209.85.192.175]:34104 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750729AbdLNFe7 (ORCPT ); Thu, 14 Dec 2017 00:34:59 -0500 X-Google-Smtp-Source: ACJfBouGWxGM5pq5a4v8D2ty+cIQdlZzs2B8JWUDT4j6QwW9iWwCEBIkepfsasgSV2ZoUxCfRtesqw== Date: Wed, 13 Dec 2017 21:34:56 -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 14/16] remoteproc: look-up pre-registered carveout by name for carveout allocation Message-ID: <20171214053456.GO17344@builder> References: <1512060411-729-1-git-send-email-loic.pallardy@st.com> <1512060411-729-15-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-15-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: > + /* By name */ > + mem = rproc_find_carveout_by_name(rproc, rsc->name); > + if (mem) { > + /* > + * Update resource table with registered carevout information > + */ > + rsc->len = mem->len; You should validate that len, da and pa are compatible. > + rsc->da = mem->da; > + rsc->pa = rproc_va_to_pa(mem->va); > + /* no need to register as already match one for one */ > + return 0; > + } Regards, Bjorn