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 0B094C433EF for ; Wed, 8 Dec 2021 16:55:52 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D072B80F90; Wed, 8 Dec 2021 17:55:49 +0100 (CET) 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="dqNd5XsT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ADCCB80FF0; Wed, 8 Dec 2021 17:55:47 +0100 (CET) Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) (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 2C7C982F96 for ; Wed, 8 Dec 2021 17:55:42 +0100 (CET) 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-xd30.google.com with SMTP id y16so3474070ioc.8 for ; Wed, 08 Dec 2021 08:55:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yaqUI3ItboGYbdjy/D5Te90yA/TqCkVzRQS2GdNrLw4=; b=dqNd5XsTIekWkE+OiZaY//2glRK5dAgDWEwjUZg0YChlEi5Wz0oCmvvdPf++4+Wfz9 EZifDnBuV7gAEo/9sTXVqcwUnNUGKwiM48GLtWI1/YTbGI8Aw8rr5ArWdF4yeZ1c30UK X7GMyjmPXvJZ/tNHkcB3orHRjziDdjZZbjdNU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yaqUI3ItboGYbdjy/D5Te90yA/TqCkVzRQS2GdNrLw4=; b=e0ww0r8FXW+MqBMcBZbGp7+gBfFZaUKyLV3ay25X63B22nV8JvLxGV+sJBnG+UHw8i QTrIlKbQ4Wz96E9Whrih3edtELiUPbu3hUV3U7CzEcI7xDpIdVnfWVgeu8jPN08KihQH eZq2Oy8+vjrDv55G7jJn9CFXENe6XNb5KDTVN2r1jxQ8pM12Pm22X5lRkdkaTu4ylAi7 yNueceUg1B92C12Y1tYJyL2zENL7bKI/P1pfL7rDJO0fCv0BUOeWpCW0bQhUONZJN1ha aNvyILkOkhyJJC40pdpdPMczVxNRT9XE7KtHyvLkYNZrPOP8RFLcX6NLEH28fxuTRsqD zmoQ== X-Gm-Message-State: AOAM533bTCB1ZgvRivmeqpFJk2Doaj4yufJ73a2UTSAP6JuXTIfHtn8E sK1KQG6GVZABTNB9eF5wpnAQ9ohCEqnETg== X-Google-Smtp-Source: ABdhPJwu9LSN2CubeyL0DL63T9G2eA0KG0HD3zoXU6I+wMDnH1PZlA7bbAi6rgxy300+P61OHMEgEA== X-Received: by 2002:a5e:8701:: with SMTP id y1mr7947952ioj.80.1638982540553; Wed, 08 Dec 2021 08:55:40 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id i26sm2938524ila.12.2021.12.08.08.55.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Dec 2021 08:55:39 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Samuel Dionne-Riel Subject: [PATCH 1/2] fdtgrep: Correct alignment of struct section Date: Wed, 8 Dec 2021 09:55:34 -0700 Message-Id: <20211208165535.3924959-1-sjg@chromium.org> X-Mailer: git-send-email 2.34.1.400.ga245620fadb-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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.2 at phobos.denx.de X-Virus-Status: Clean When outputting a devicetree we should not align the struct section to a 16-byte boundary. The normal position is fine, which is 8-byte aligned. This avoids leaving adding 8 extra zero bytes in the output tree in the case where the reserved section is empty (i.e has 16 zero bytes). Signed-off-by: Simon Glass --- tools/fdtgrep.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/fdtgrep.c b/tools/fdtgrep.c index db512465db1..641d6a2e3e0 100644 --- a/tools/fdtgrep.c +++ b/tools/fdtgrep.c @@ -438,8 +438,7 @@ static int dump_fdt_regions(struct display_info *disp, const void *blob, fdt = (struct fdt_header *)out; memset(fdt, '\0', sizeof(*fdt)); fdt_set_magic(fdt, FDT_MAGIC); - struct_start = FDT_ALIGN(sizeof(struct fdt_header), - sizeof(struct fdt_reserve_entry)); + struct_start = sizeof(struct fdt_header); fdt_set_off_mem_rsvmap(fdt, struct_start); fdt_set_version(fdt, FDT_LAST_SUPPORTED_VERSION); fdt_set_last_comp_version(fdt, FDT_FIRST_SUPPORTED_VERSION); -- 2.34.1.400.ga245620fadb-goog