[16/21] bloblist: Tidy up a few comments and code-style nits
diff mbox series

Message ID 20200127084920.16.If57a0ad7fb8aeef04ec034b19c95cd24b4fb9644@changeid
State Accepted
Commit 02247c1887312e5b4b367e4fb12122381b1424bc
Delegated to: Simon Glass
Headers show
Series
  • dm: Various enhancements to prepare for ACPI
Related show

Commit Message

Simon Glass Jan. 27, 2020, 3:49 p.m. UTC
Add a messing error code to bloblist_new() and tidy up the line length in
bloblist_addrec().

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 common/bloblist.c  | 5 ++---
 include/bloblist.h | 3 ++-
 2 files changed, 4 insertions(+), 4 deletions(-)

Comments

Simon Glass Feb. 5, 2020, 5:55 p.m. UTC | #1
Add a messing error code to bloblist_new() and tidy up the line length in
bloblist_addrec().

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 common/bloblist.c  | 5 ++---
 include/bloblist.h | 3 ++-
 2 files changed, 4 insertions(+), 4 deletions(-)

Applied to u-boot-dm, thanks!

Patch
diff mbox series

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);