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 09B23C7618A for ; Sun, 19 Mar 2023 17:31:18 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0D5EB85A26; Sun, 19 Mar 2023 18:31:16 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=mailbox.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; secure) header.d=mailbox.org header.i=@mailbox.org header.b="u3zV9pSa"; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b="juYn+qOq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 79AE585A57; Sun, 19 Mar 2023 18:31:14 +0100 (CET) Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [IPv6:2001:67c:2050:0:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DDB1185997 for ; Sun, 19 Mar 2023 18:31:11 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=mailbox.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=marek.vasut@mailbox.org Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4PflJs5D8Rz9sSX; Sun, 19 Mar 2023 18:31:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1679247069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=isMxWDGcctBWPVQaUwStd8GtZQfzf7VoX6BY3sTRlFo=; b=u3zV9pSa57Mgut1hspqEOo4wvgMCOaZ8XGQAqgmV6sN2gaeQFvwHI1YFGQp9oS7q4zXlH1 zwlrpwktBKxBoXG6kVzlaxPNhwBjJGLZceRmBOeleQ74ibh5DXqjOPHwFxcClIn3PMgBcg Wfd8VIgPycGrlNVtx94kWE49Yn77JKmwKKyAcqp/x9J+uY68rRVr04tXYzPk/tdNfQlvC/ LWQ/icZU95TPV0erlXGIcKXbZlgsqUsa+u3n7RoNPNqSQuS8ZqoAOXM9w0RdH1wlnRsLA+ /KGtHj9RFN5OjbvafDRAUDocOSceSBBudsVQNRqcBbHqk69FpEL7LFKFYpYPqw== Message-ID: <4435e266-e111-d8cb-3e60-490a5aa23160@mailbox.org> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1679247067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=isMxWDGcctBWPVQaUwStd8GtZQfzf7VoX6BY3sTRlFo=; b=juYn+qOqoGh5Lvzubxr1xgt4Dg6rO3wBLBAXchpE7PN7mAayqcctHWpX/vE5cetq+LZHRP mAelAIhyMVldt5t6bMnCAOVtkQip1mjoGSl3gULUpVBvh+onNsjR/WiBKJn8t4DJqXDGle NkIsMpzNBeB44k7JN0y85y6Zxe8P+c7epCGhEnqYsVT4Zu5lE+ECKwRT32WUlICOk+Ca2r tV0w5aQIvkiC1Bhmr4lEOZkCaMUMC4HgpJSOpYIwPWh+YYEU9pYDDY6r2x/xtEeAgdmn4P qIWVSlzWZ7Lt4+Kq5sOB9ekvoCBJROcgazZhv7NIXjnAvABwMxJNkkyrA3yNag== Date: Sun, 19 Mar 2023 18:31:04 +0100 MIME-Version: 1.0 Subject: Re: [PATCH] fdt: Make fdt addr -q quieter Content-Language: en-US To: Peter Hoyes , u-boot@lists.denx.de Cc: andre.przywara@arm.com, sjg@chromium.org, daniel@makrotopia.org, pali@kernel.org, philippe.reynes@softathome.com, sean.anderson@seco.com, marek.vasut+renesas@mailbox.org, xypron.glpk@gmx.de References: <20230316163442.3120729-1-peter.hoyes@arm.com> <9e692146-1906-8787-c650-c644a65c5d70@mailbox.org> <2b1ac580-540f-2b20-75d4-16bda19c9a88@arm.com> From: Marek Vasut In-Reply-To: <2b1ac580-540f-2b20-75d4-16bda19c9a88@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-MBO-RS-ID: 3e35503abc0cdb11a81 X-MBO-RS-META: fxn8t5m7qng73f8f7dmxwdspmz9ofj34 X-Rspamd-Queue-Id: 4PflJs5D8Rz9sSX 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.8 at phobos.denx.de X-Virus-Status: Clean On 3/17/23 18:27, Peter Hoyes wrote: > On 17/03/2023 12:17, Marek Vasut wrote: >> On 3/16/23 17:34, Peter Hoyes wrote: >>> From: Peter Hoyes >>> >>> 64597346 "fdt: Add -q option to fdt addr for distro_bootcmd" introduced >>> the -q option for fdt addr, which sets the current working fdt address >>> without printing any output. >>> >>> baf41410 "fdt: Show a message when the working FDT changes" made the >>> utility function set_working_fdt_addr (in cmd/fdt.c) output a message >>> on each invocation, even if called via fdt addr -q, in which case its >>> output is now slightly noisier. >>> >>> To fix this, move the printf outside of set_working_fdt_addr to three >>> call sites: >>>   * bootm_find_images (the use case for which the additional output was >>>     added in baf41410). >>>   * fdt addr, but only if the 'quiet' argument is not set. >>>   * fdt move. >>> >>> This also has the advantage of printing the specified address instead of >>> the translated address when using the sandbox. >>> >>> Remove assertions from the fdt addr test case when: >>>   * Calling set_working_fdt_addr directly. >>>   * Calling fdt addr with the -q argument. >> >> Why not just pass the 'quiet' flag to set_working_fdt_addr() to avoid >> duplication ? > > I considered this too, but there are other machine-specific call sites > and I was trying to avoid adding an extra argument everywhere just for > logging. > > I'll send a v2 with a 'quiet' argument on Monday. Hmmmm, what about creating a wrapper with the extra logging ? That way, you can have the logging in one place, without introducing the extra parameter. int set_working_fdt_addr_verbose(...) { ret = set_working_fdt_addr(); printf(...); return ret; }