From patchwork Mon Jan 27 15:49:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1229917 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=l93Vox0u; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 485vRS3Dk9z9sNx for ; Tue, 28 Jan 2020 02:53:24 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 415E181A53; Mon, 27 Jan 2020 16:51:36 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (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=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="l93Vox0u"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5A12481A2A; Mon, 27 Jan 2020 16:50:32 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) (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 B5A1A81A27 for ; Mon, 27 Jan 2020 16:50:22 +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-xd43.google.com with SMTP id h8so10510896iob.2 for ; Mon, 27 Jan 2020 07:50:22 -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=NFk25ueCNTI5XCc4j/0E8H5fHUrVFEmIUkTr4EnRuBY=; b=l93Vox0uGDSUKihVY/2vIXoXGDYXsDZu94Maf3folG+SkKcbyWCDEHxuJlII8TXgk5 feIvgnVeYZtev0dIA+tv1+2OG8JrNDE0lJTlVLQhreOrCE5YxSJkZBsv7OtFfDndvGeg 2jkyoAfYLLwg1FC6cjXBtUHuUH/4FZFOFqdMw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NFk25ueCNTI5XCc4j/0E8H5fHUrVFEmIUkTr4EnRuBY=; b=LE73ngFsL4ex+p0baw/J7zraxq20CpwlfvVLDoBLNp+B8kJNRKnDlFLGUC4bWl+khk d7AaoFXHA6FpeZAJVrQn8rVXC0D0kNVO9plyQv67Eofekb+ggdp6l27nfWCLpJf2n1qk Bdnvo871tFgoYU2668FLwdj9ENlNAG5/wsiDF/cPg2J4x9QikON5zRW/YlMv9YDlBCDQ VVNTehocfRhaUcVCVdyh/BFB1Icv+cAUt1phzTiqVIIN11Qy/Dpr+TcIMshQrr/rFhah nk6wZ408otCa95RYcW6NVrRImCMgQXK+6pofFmnItwbq6OsGFN4klYOWeItkxy69r7AU wryQ== X-Gm-Message-State: APjAAAVBjsU5DcbcNmT/fXkLqpmprhQNBL6bcqhJWdg/p4e/lNhkwTsq CNE6rErt2+Qdk4Xz6BISiSBC+60JQ0k= X-Google-Smtp-Source: APXvYqyn/gPPTTU8IaW3tS3xOC/GEnSvrzxTlOlwCzpap2ogsUt6pjhSZfWu4qNxtgNO6cb4kHCkKQ== X-Received: by 2002:a5e:df46:: with SMTP id g6mr12970263ioq.240.1580140221284; Mon, 27 Jan 2020 07:50:21 -0800 (PST) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id v7sm3576560iom.58.2020.01.27.07.50.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2020 07:50:21 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Subject: [PATCH 16/21] bloblist: Tidy up a few comments and code-style nits Date: Mon, 27 Jan 2020 08:49:51 -0700 Message-Id: <20200127084920.16.If57a0ad7fb8aeef04ec034b19c95cd24b4fb9644@changeid> X-Mailer: git-send-email 2.25.0.341.g760bfbb309-goog In-Reply-To: <20200127154956.64368-1-sjg@chromium.org> References: <20200127154956.64368-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 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.101.4 at phobos.denx.de X-Virus-Status: Clean Add a messing error code to bloblist_new() and tidy up the line length in bloblist_addrec(). Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- common/bloblist.c | 5 ++--- include/bloblist.h | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/bloblist.c b/common/bloblist.c index 0c87115e81..e2b7cc62e0 100644 --- a/common/bloblist.c +++ b/common/bloblist.c @@ -59,11 +59,10 @@ static int bloblist_addrec(uint tag, int size, struct bloblist_rec **recp) struct bloblist_rec *rec; int new_alloced; - new_alloced = hdr->alloced + sizeof(*rec) + - ALIGN(size, BLOBLIST_ALIGN); + new_alloced = hdr->alloced + sizeof(*rec) + ALIGN(size, BLOBLIST_ALIGN); if (new_alloced >= hdr->size) { log(LOGC_BLOBLIST, LOGL_ERR, - "Failed to allocate %x bytes size=%x, need size>=%x\n", + "Failed to allocate %x bytes size=%x, need size=%x\n", size, hdr->size, new_alloced); return log_msg_ret("bloblist add", -ENOSPC); } diff --git a/include/bloblist.h b/include/bloblist.h index 8c9ce98a3b..609ac421d6 100644 --- a/include/bloblist.h +++ b/include/bloblist.h @@ -183,7 +183,8 @@ int bloblist_new(ulong addr, uint size, uint flags); * @return 0 if OK, -ENOENT if the magic number doesn't match (indicating that * there problem is no bloblist at the given address), -EPROTONOSUPPORT * if the version does not match, -EIO if the checksum does not match, - * -EFBIG if the expected size does not match the detected size + * -EFBIG if the expected size does not match the detected size, -ENOSPC + * if the size is not large enough to hold the headers */ int bloblist_check(ulong addr, uint size);