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 83A3BC433F5 for ; Thu, 13 Jan 2022 02:27:52 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5E87F8344C; Thu, 13 Jan 2022 03:27:11 +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="GMdP9H5E"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 55B70832DD; Thu, 13 Jan 2022 03:26:59 +0100 (CET) Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) (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 658B383394 for ; Thu, 13 Jan 2022 03:26:55 +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-il1-x129.google.com with SMTP id c4so4290401iln.7 for ; Wed, 12 Jan 2022 18:26:55 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=W8fJtwytbJo1DakwW9jLphp+bpEW7btgUs8zwjHn2iI=; b=GMdP9H5EZBBm1uwnnAZT14iMCVRWtcx2FIjl+QFZJlLSGVfiNxoxdNE5l0Kb/FdPGh s5U6SJpU63NDBfWhAH0p3fPPTqms6wEfHXKTwbUqaRIAiqlQR0U1swBWBPmRzQrmGw4r wswgsXgYPtoSLO8BVr8oGqeYzEGle7TElTeic= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=W8fJtwytbJo1DakwW9jLphp+bpEW7btgUs8zwjHn2iI=; b=CJWVJp7CZDK7HqRZl5zcnIVHqTqJvSqf8u051IMEVCnzgelioU/CSMp9/Ree9Z6Vnr qJGfl7LYGfp0afwQ2y0kgeA8Hydk8yKOxlu9Y/vPmxN7YU+jJ9Gg7RCl0cl6Ur0osrRs JeD0H8kXAYRuSe29X/gBhnXHwY8c90shi+XAhkqBwi1bmn3AFd3huEVMBl7VHPKHlIu/ Snw4+APjD1YCyk1YCNV7+9d1+HVEUZnvKeD5kaVQu9m+cdJZOfWx97x4x08Qt62rHU36 iMlU58VytxERZX2ACVBHeVkk/NZx0xIHcmE8xkPxwF19T2uDZ1MfVl982IQpPwfwFWzK PdHw== X-Gm-Message-State: AOAM531wmxD4OGJiLqgcARddRwvATibyoZ6hrSIs1V6RT6hONdI3p75l 6s8wkBs52vj2heh/BCgUbgpmnketgUWznQ== X-Google-Smtp-Source: ABdhPJxsvG0Eoe1pYusPFfEVdn2+tIdpv00AS6pV0/neGuM69H2QKpWeK+HWSFBwm4VlwnciXuvRLA== X-Received: by 2002:a05:6e02:190e:: with SMTP id w14mr1370009ilu.98.1642040813958; Wed, 12 Jan 2022 18:26:53 -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 e17sm965634ili.37.2022.01.12.18.26.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 18:26:53 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v2 07/12] bloblist: Use LOG_CATEGORY to simply logging Date: Wed, 12 Jan 2022 19:26:20 -0700 Message-Id: <20220113022625.413990-8-sjg@chromium.org> X-Mailer: git-send-email 2.34.1.575.g55b058a8bb-goog In-Reply-To: <20220113022625.413990-1-sjg@chromium.org> References: <20220113022625.413990-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.2 at phobos.denx.de X-Virus-Status: Clean Use the convenience functions to improve readability. Signed-off-by: Simon Glass --- (no changes since v1) common/bloblist.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/common/bloblist.c b/common/bloblist.c index baf1d371b71..b5fea12b697 100644 --- a/common/bloblist.c +++ b/common/bloblist.c @@ -4,6 +4,8 @@ * Written by Simon Glass */ +#define LOG_CATEGORY LOGC_BLOBLIST + #include #include #include @@ -133,9 +135,8 @@ static int bloblist_addrec(uint tag, int size, int align, new_alloced = data_start + ALIGN(size, align); if (new_alloced > hdr->size) { - log(LOGC_BLOBLIST, LOGL_ERR, - "Failed to allocate %x bytes size=%x, need size=%x\n", - size, hdr->size, new_alloced); + log_err("Failed to allocate %x bytes size=%x, need size=%x\n", + size, hdr->size, new_alloced); return log_msg_ret("bloblist add", -ENOSPC); } rec = (void *)hdr + hdr->alloced; @@ -249,14 +250,13 @@ static int bloblist_resize_rec(struct bloblist_hdr *hdr, expand_by = ALIGN(new_size - rec->size, BLOBLIST_ALIGN); new_alloced = ALIGN(hdr->alloced + expand_by, BLOBLIST_ALIGN); if (new_size < 0) { - log(LOGC_BLOBLIST, LOGL_DEBUG, - "Attempt to shrink blob size below 0 (%x)\n", new_size); + log_debug("Attempt to shrink blob size below 0 (%x)\n", + new_size); return log_msg_ret("size", -EINVAL); } if (new_alloced > hdr->size) { - log(LOGC_BLOBLIST, LOGL_ERR, - "Failed to allocate %x bytes size=%x, need size=%x\n", - new_size, hdr->size, new_alloced); + log_err("Failed to allocate %x bytes size=%x, need size=%x\n", + new_size, hdr->size, new_alloced); return log_msg_ret("alloc", -ENOSPC); } @@ -347,8 +347,7 @@ int bloblist_check(ulong addr, uint size) return log_msg_ret("Bad size", -EFBIG); chksum = bloblist_calc_chksum(hdr); if (hdr->chksum != chksum) { - log(LOGC_BLOBLIST, LOGL_ERR, "Checksum %x != %x\n", hdr->chksum, - chksum); + log_err("Checksum %x != %x\n", hdr->chksum, chksum); return log_msg_ret("Bad checksum", -EIO); } gd->bloblist = hdr; @@ -446,7 +445,7 @@ int bloblist_init(void) } ret = bloblist_new(addr, CONFIG_BLOBLIST_SIZE, 0); } else { - log(LOGC_BLOBLIST, LOGL_DEBUG, "Found existing bloblist\n"); + log_debug("Found existing bloblist\n"); } return ret; -- 2.34.1.575.g55b058a8bb-goog