Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2090636ybf; Mon, 2 Mar 2020 01:40:40 -0800 (PST) X-Google-Smtp-Source: APXvYqwmBmhKvNQ2Zbw2EcUezR0jNHfWUqIHPAzMeSMnetTM9MTCw/eKIxT86K9kNHc5rCp4Ya0T X-Received: by 2002:a05:6830:19:: with SMTP id c25mr6483638otp.349.1583142040783; Mon, 02 Mar 2020 01:40:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583142040; cv=none; d=google.com; s=arc-20160816; b=UtPpG0mL4Y4AqKO9MYRQguEQOPDV6LSakCFZkUGYbYhMxmHLFiAhNPvA029cDrlPhS YOssOh0e/PpMX0aSfAfAdQX65TiBU9ZE5xBGJPZ6+e1AZXGp1wgp5EY8Gski5as9lT6h WxgWMF1Dy3rE8QO0NUacDITnfxMUARk+yWGY57QiKXP5TtbIg3vpmEqaZGhKiLX3FF75 BgpVH6l5uuQM/d7oYXx9HhuG1BbA0nC2njWENEIzCEbcLYT76Fb7CkY58RpXOcdHOh9f QuCIf4TAqtHjVbMSQUveKIK7l2kL+7B1yJitDbi7C8JGPmS8BsJEYqOXEMHCCCPkrryD sWbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=5xljbTWOERHr9lOzHshdHv3G1M72mnOCyIfPcXNIJyA=; b=Pj8xUErlRj06StYJG5YlsRWiJEnoumxUi3wQV8tAa8qCz+K8F6XhiAR9JowigI3rKq OdEj/qQXaMKdGvf4pSO0T/3Sbnv4h58npvriOmMS1mxXpsrDrXHqDouJIDBSMVzGfgD/ KSwiV1KJr6tswwik+d8nk+FQHr5rx8YDZ47q/VCOruDxN4WGMt+a5H0IkKA2KnzmPsWL S+hCKLaGWt5grt2PpiivXRGNcBRY+Hy27/qD9DgwNorRdYnVayrYgm/Ofd3mzhkDz47N zveRLAyItdf8WDnoalUF8I7/DKZXmX1sflXnqepQLGZIRF5NPXNwsnSB45vCifGKKdjK qzFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kalray.eu header.s=32AE1B44-9502-11E5-BA35-3734643DEF29 header.b=OAS6ZbvZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=kalray.eu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l128si1834673oih.238.2020.03.02.01.40.29; Mon, 02 Mar 2020 01:40:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kalray.eu header.s=32AE1B44-9502-11E5-BA35-3734643DEF29 header.b=OAS6ZbvZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=kalray.eu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727671AbgCBJjV (ORCPT + 99 others); Mon, 2 Mar 2020 04:39:21 -0500 Received: from zimbra2.kalray.eu ([92.103.151.219]:38180 "EHLO zimbra2.kalray.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727517AbgCBJjR (ORCPT ); Mon, 2 Mar 2020 04:39:17 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTP id 356BD27E080F; Mon, 2 Mar 2020 10:39:16 +0100 (CET) Received: from zimbra2.kalray.eu ([127.0.0.1]) by localhost (zimbra2.kalray.eu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id tbFpWZqsFRvR; Mon, 2 Mar 2020 10:39:15 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTP id D70EE27E0309; Mon, 2 Mar 2020 10:39:15 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.10.3 zimbra2.kalray.eu D70EE27E0309 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kalray.eu; s=32AE1B44-9502-11E5-BA35-3734643DEF29; t=1583141955; bh=5xljbTWOERHr9lOzHshdHv3G1M72mnOCyIfPcXNIJyA=; h=From:To:Date:Message-Id; b=OAS6ZbvZPKd3d666kFuWJIdyeqOFRh2f1lMYpUTkxHT6FpZJ3SrHUG2nfwy3wS/PR cUkjQnR0l5aWXytVCqQsC9oINp2Iucu/MPL66ua7EgiD6KMAfHaGbgGsyWlVCcdhtD 6Mb4yx1j8ChS7IIY8K+QjvkwGS4ITa1KPc6NTcvI= X-Virus-Scanned: amavisd-new at zimbra2.kalray.eu Received: from zimbra2.kalray.eu ([127.0.0.1]) by localhost (zimbra2.kalray.eu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id YO31vard5ZvB; Mon, 2 Mar 2020 10:39:15 +0100 (CET) Received: from triton.lin.mbt.kalray.eu (unknown [192.168.37.25]) by zimbra2.kalray.eu (Postfix) with ESMTPSA id B16DD27E0840; Mon, 2 Mar 2020 10:39:15 +0100 (CET) From: Clement Leger To: Ohad Ben-Cohen , Bjorn Andersson , Jonathan Corbet , Shawn Guo , Sascha Hauer , linux-remoteproc@vger.kernel.org Cc: Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Andy Gross , Patrice Chotard , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Arnaud Pouliquen , Loic PALLARDY , s-anna , Mathieu Poirier , Clement Leger Subject: [PATCH v5 7/8] remoteproc: Allow overriding only sanity_check Date: Mon, 2 Mar 2020 10:39:01 +0100 Message-Id: <20200302093902.27849-8-cleger@kalray.eu> X-Mailer: git-send-email 2.15.0.276.g89ea799 In-Reply-To: <20200302093902.27849-1-cleger@kalray.eu> References: <20200210162209.23149-1-cleger@kalray.eu> <20200302093902.27849-1-cleger@kalray.eu> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that rproc_elf_sanity_check can be used by external drivers, allow to only overwrite the sanity_check member of rproc_ops. This will allow drivers to handle elf32 and elf64 by overwriting sanity_check with rproc_elf_sanity_check function. Signed-off-by: Clement Leger --- drivers/remoteproc/remoteproc_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 99f0b796fbc7..b932a64a2be2 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -2055,7 +2055,8 @@ struct rproc *rproc_alloc(struct device *dev, const char *name, rproc->ops->load = rproc_elf_load_segments; rproc->ops->parse_fw = rproc_elf_load_rsc_table; rproc->ops->find_loaded_rsc_table = rproc_elf_find_loaded_rsc_table; - rproc->ops->sanity_check = rproc_elf32_sanity_check; + if (!rproc->ops->sanity_check) + rproc->ops->sanity_check = rproc_elf32_sanity_check; rproc->ops->get_boot_addr = rproc_elf_get_boot_addr; } -- 2.15.0.276.g89ea799