Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BE458C433FE for ; Thu, 13 Oct 2022 12:39:37 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E584D84F51; Thu, 13 Oct 2022 14:37:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="bWJb2A/f"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 77B6E84F2F; Thu, 13 Oct 2022 14:37:57 +0200 (CEST) Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B075A84F48 for ; Thu, 13 Oct 2022 14:30:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd29.google.com with SMTP id h203so1190207iof.1 for ; Thu, 13 Oct 2022 05:30:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=d+PGl7aX3ZTaZDwFIE8wWKvIF/wI/vU0Vkg5ZNTsceU=; b=bWJb2A/f20N9bGbp7iNQTQw30Pt88oZ6i1Mi6Qu/xALWHUqyr1vG5klHTemt4V7o3C paIFCE2pX3/LtYz85srpvSo8hB/rXR3x1+QDRkXtNFLCEVvxvChjJe55xdpRelEnI6vV /z8jjPdGILdO+ViD80lGTecVuAuL4iBZs+urM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d+PGl7aX3ZTaZDwFIE8wWKvIF/wI/vU0Vkg5ZNTsceU=; b=K4pPOCoN1RknViTY3nvPD8dGxeoB1jaxV99XpTpIi6Rv1A73uVL/wney0bZnE1q1a1 iH+DeaydR1Zuy0mbXxceQRJEELpfirMw9HpDaG6eHpzsMZQP/KltlR+CoPIX8RMoSVlD XYYFd5O3tDapUguct1/fhhKMMGwZonwP7q13S77BRcQLjEIIgyvuuVRYvvp+cthZnZ9F 3QYd+qrSb09NcmnvQsBfxuApIzMABjnn07fWFoaRdjkxPqhEhb9aQNmqLSJoDOYcB/vE arsHhzNXptuFgx9D+f1KTK/+fFAZ4p4u6v9/G5TBk8Kbkh/L3zRQtQScqGDnmjsxY9UD VETg== X-Gm-Message-State: ACrzQf290JQdBK640iBLFUlCs8IVwc+S+g6zAIFaxIJFo3k+QpDfVNWh VXHCC8gJJcOMub4MhwIoBOxhGLDGFs00bQ== X-Google-Smtp-Source: AMsMyM4yTeVo4gVmVbpTNn5UeE47iVXryL7O70CQ46159ZjgNt2GU5jmWkRgV8VLG7UYKTIpCqTSQw== X-Received: by 2002:a02:2711:0:b0:35a:4fb3:efcf with SMTP id g17-20020a022711000000b0035a4fb3efcfmr17955574jaa.14.1665664232870; Thu, 13 Oct 2022 05:30:32 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-67-190-102-125.hsd1.co.comcast.net. [67.190.102.125]) by smtp.gmail.com with ESMTPSA id a9-20020a027a09000000b003635ab4a7b7sm7321626jac.3.2022.10.13.05.30.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Oct 2022 05:30:32 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Andre Przywara , Artem Lapkin , Daniel Golle , Heinrich Schuchardt , Jan Kiszka , Joe Hershberger , Joel Stanley , Marek Vasut , Philippe Reynes , Sean Anderson Subject: [PATCH v2 24/45] image: Move comment for fit_conf_find_compat() Date: Thu, 13 Oct 2022 06:29:06 -0600 Message-Id: <20221013122927.636867-25-sjg@chromium.org> X-Mailer: git-send-email 2.38.0.rc1.362.ged0d419d3c-goog In-Reply-To: <20221013122927.636867-1-sjg@chromium.org> References: <20221013122927.636867-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Move this comment to the header file, where the APIs should be defined. Signed-off-by: Simon Glass --- Changes in v2: - Update the comment style boot/image-fit.c | 43 ------------------------------------------- include/image.h | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 43 deletions(-) diff --git a/boot/image-fit.c b/boot/image-fit.c index 6e503f827dd..02f1d28c771 100644 --- a/boot/image-fit.c +++ b/boot/image-fit.c @@ -1686,49 +1686,6 @@ int fit_check_format(const void *fit, ulong size) return 0; } -/** - * fit_conf_find_compat - * @fit: pointer to the FIT format image header - * @fdt: pointer to the device tree to compare against - * - * fit_conf_find_compat() attempts to find the configuration whose fdt is the - * most compatible with the passed in device tree. - * - * Example: - * - * / o image-tree - * |-o images - * | |-o fdt-1 - * | |-o fdt-2 - * | - * |-o configurations - * |-o config-1 - * | |-fdt = fdt-1 - * | - * |-o config-2 - * |-fdt = fdt-2 - * - * / o U-Boot fdt - * |-compatible = "foo,bar", "bim,bam" - * - * / o kernel fdt1 - * |-compatible = "foo,bar", - * - * / o kernel fdt2 - * |-compatible = "bim,bam", "baz,biz" - * - * Configuration 1 would be picked because the first string in U-Boot's - * compatible list, "foo,bar", matches a compatible string in the root of fdt1. - * "bim,bam" in fdt2 matches the second string which isn't as good as fdt1. - * - * As an optimization, the compatible property from the FDT's root node can be - * copied into the configuration node in the FIT image. This is required to - * match configurations with compressed FDTs. - * - * returns: - * offset to the configuration to use if one was found - * -1 otherwise - */ int fit_conf_find_compat(const void *fit, const void *fdt) { int ndepth = 0; diff --git a/include/image.h b/include/image.h index eb2513c5b74..5cbe90e7553 100644 --- a/include/image.h +++ b/include/image.h @@ -1206,6 +1206,47 @@ int fit_image_check_comp(const void *fit, int noffset, uint8_t comp); */ int fit_check_format(const void *fit, ulong size); +/** + * fit_conf_find_compat() - find most compatible configuration + * @fit: pointer to the FIT format image header + * @fdt: pointer to the device tree to compare against + * + * Attempts to find the configuration whose fdt is the most compatible with the + * passed in device tree + * + * Example:: + * + * / o image-tree + * |-o images + * | |-o fdt-1 + * | |-o fdt-2 + * | + * |-o configurations + * |-o config-1 + * | |-fdt = fdt-1 + * | + * |-o config-2 + * |-fdt = fdt-2 + * + * / o U-Boot fdt + * |-compatible = "foo,bar", "bim,bam" + * + * / o kernel fdt1 + * |-compatible = "foo,bar", + * + * / o kernel fdt2 + * |-compatible = "bim,bam", "baz,biz" + * + * Configuration 1 would be picked because the first string in U-Boot's + * compatible list, "foo,bar", matches a compatible string in the root of fdt1. + * "bim,bam" in fdt2 matches the second string which isn't as good as fdt1. + * + * As an optimization, the compatible property from the FDT's root node can be + * copied into the configuration node in the FIT image. This is required to + * match configurations with compressed FDTs. + * + * Returns: offset to the configuration to use if one was found, -1 otherwise + */ int fit_conf_find_compat(const void *fit, const void *fdt); /** -- 2.38.0.rc1.362.ged0d419d3c-goog