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 C48FAC433F5 for ; Tue, 11 Oct 2022 15:49:44 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4556084F1F; Tue, 11 Oct 2022 17:48:46 +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="h3FGJg2Y"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 22F1E84F24; Tue, 11 Oct 2022 17:48:24 +0200 (CEST) Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) (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 449AE84F19 for ; Tue, 11 Oct 2022 17:48:16 +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-il1-x12d.google.com with SMTP id y17so7353997ilq.8 for ; Tue, 11 Oct 2022 08:48:16 -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=CvN101E0YBuqFtaXKfToou9giIsKybVBzZd8RR1qDfc=; b=h3FGJg2YpgLvCVgp5k9m/Yo5vIlntlSw/7fZcvY+uWN4cTHMRKo2+Rc5yE7YsWjJnI uniGGWYFVOhaTmShef9hbP8xfndYtX6ZUUa4xzfGSswF7E1A/hOPo8Dif7vIt45xr8sG wJVgIulMIsMZi7EkJKN1sPK0E3GpdUFzSpBbo= 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=CvN101E0YBuqFtaXKfToou9giIsKybVBzZd8RR1qDfc=; b=FOlTxcGN07tBdFJdBXWjKU4YASYqWFjHWkVzHg71UKaw2omauodNCqV0szt9T7pJhn x07D+BNVm2l7WfIXtE1kTW0YpwVUzaA3azZWcQbbx8yRTqT8qGTdOmLiKQrO2SmQ6/US 3+sj6G5veqac9B4bi0Spporh6flME5i4pV+Y5yLXdiI+r3VcLolM3VZ5oBgiC6oXZszx g/TXcnlkbvawHmCzExxbjGlve88dy2cZAAC+9JelMowkFpmDd1R2t7oA7F4CrE9Mr5Kt b+ixvehrWnVQwkR+5RDpANK9sqICP8E5vT7Lkhyn/A6WBnbMp38mSqTkfGNKz0UIT48k kUqw== X-Gm-Message-State: ACrzQf0CyJRREqvEYQRFyMHanQgwkGE9wyGg5gxiQYQHwZ0p1m7dPLys dysTEULzGAcLK+/Op5sDlhfcNXfFLy5g3A== X-Google-Smtp-Source: AMsMyM6ixu+hikcvqF76V+IMYbR3ZRqMDMrPRtjgryqInR7LBTT9zcfsaDJYf11mswpGL0ceX5pFrA== X-Received: by 2002:a05:6e02:160c:b0:2fc:1bc4:1811 with SMTP id t12-20020a056e02160c00b002fc1bc41811mr7027988ilu.306.1665503295385; Tue, 11 Oct 2022 08:48:15 -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 r12-20020a922a0c000000b002f9b55e7e92sm4988680ile.0.2022.10.11.08.48.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Oct 2022 08:48:14 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Heinrich Schuchardt Subject: [PATCH v2 10/14] boot: Tidy up logging and naming in vbe_simple Date: Tue, 11 Oct 2022 09:47:16 -0600 Message-Id: <20221011154720.550320-11-sjg@chromium.org> X-Mailer: git-send-email 2.38.0.rc1.362.ged0d419d3c-goog In-Reply-To: <20221011154720.550320-1-sjg@chromium.org> References: <20221011154720.550320-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 Make sure the log_msg_ret() values are unique so that the log trace is unambiguous with LOG_ERROR_RETURN. Also avoid reusing the 'node' variable for two different nodes in bootmeth_vbe_simple_ft_fixup(), since this is confusing. Signed-off-by: Simon Glass --- (no changes since v1) boot/vbe_simple.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/boot/vbe_simple.c b/boot/vbe_simple.c index 61b6322ebe2..076b650c25a 100644 --- a/boot/vbe_simple.c +++ b/boot/vbe_simple.c @@ -6,6 +6,8 @@ * Written by Simon Glass */ +#define LOG_CATEGORY LOGC_BOOT + #include #include #include @@ -199,17 +201,17 @@ int vbe_simple_fixup_node(ofnode node, struct simple_state *state) version = strdup(state->fw_version); if (!version) - return log_msg_ret("ver", -ENOMEM); + return log_msg_ret("dup", -ENOMEM); ret = ofnode_write_string(node, "cur-version", version); if (ret) return log_msg_ret("ver", ret); ret = ofnode_write_u32(node, "cur-vernum", state->fw_vernum); if (ret) - return log_msg_ret("ver", ret); + return log_msg_ret("num", ret); ret = ofnode_write_string(node, "bootloader-version", version_string); if (ret) - return log_msg_ret("fix", ret); + return log_msg_ret("bl", ret); return 0; } @@ -233,7 +235,7 @@ static int bootmeth_vbe_simple_ft_fixup(void *ctx, struct event *event) */ for (vbe_find_first_device(&dev); dev; vbe_find_next_device(&dev)) { struct simple_state state; - ofnode node; + ofnode node, subnode; int ret; if (strcmp("vbe_simple", dev->driver->name)) @@ -243,8 +245,8 @@ static int bootmeth_vbe_simple_ft_fixup(void *ctx, struct event *event) node = oftree_path(tree, "/chosen/fwupd"); if (!ofnode_valid(node)) continue; - node = ofnode_find_subnode(node, dev->name); - if (!ofnode_valid(node)) + subnode = ofnode_find_subnode(node, dev->name); + if (!ofnode_valid(subnode)) continue; log_debug("Fixing up: %s\n", dev->name); @@ -255,7 +257,7 @@ static int bootmeth_vbe_simple_ft_fixup(void *ctx, struct event *event) if (ret) return log_msg_ret("read", ret); - ret = vbe_simple_fixup_node(node, &state); + ret = vbe_simple_fixup_node(subnode, &state); if (ret) return log_msg_ret("fix", ret); } -- 2.38.0.rc1.362.ged0d419d3c-goog