diff mbox series

[v4,03/13] cbfs: Use bool type for whether initialised

Message ID 20200524173815.v4.3.I33a5328835731b211dd8b95feb9a89e8b8b54daf@changeid
State Accepted
Commit 381e1130a2c0cd4cf1d605bf9345673a9240ec30
Headers show
Series x86: cbfs: Various clean-ups to CBFS implementation | expand

Commit Message

Simon Glass May 24, 2020, 11:38 p.m. UTC
At present this uses an int type. U-Boot now supports bool so use this
instead.

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

Changes in v4:
- Stick with US spelling

Changes in v3: None
Changes in v2: None

 fs/cbfs/cbfs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Bin Meng May 25, 2020, 1:13 a.m. UTC | #1
On Mon, May 25, 2020 at 7:38 AM Simon Glass <sjg at chromium.org> wrote:
>
> At present this uses an int type. U-Boot now supports bool so use this
> instead.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
> Changes in v4:
> - Stick with US spelling
>
> Changes in v3: None
> Changes in v2: None
>
>  fs/cbfs/cbfs.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
diff mbox series

Patch

diff --git a/fs/cbfs/cbfs.c b/fs/cbfs/cbfs.c
index 846102dce3..91d7af0493 100644
--- a/fs/cbfs/cbfs.c
+++ b/fs/cbfs/cbfs.c
@@ -12,7 +12,7 @@  static const u32 good_magic = 0x4f524243;
 static const u8 good_file_magic[] = "LARCHIVE";
 
 struct cbfs_priv {
-	int initialized;
+	bool initialized;
 	struct cbfs_header header;
 	struct cbfs_cachenode *file_cache;
 	enum cbfs_result result;
@@ -207,7 +207,7 @@  static void cbfs_init(struct cbfs_priv *priv, ulong end_of_rom)
 {
 	u8 *start_of_rom;
 
-	priv->initialized = 0;
+	priv->initialized = false;
 
 	if (file_cbfs_load_header(end_of_rom, &priv->header))
 		return;
@@ -217,7 +217,7 @@  static void cbfs_init(struct cbfs_priv *priv, ulong end_of_rom)
 	file_cbfs_fill_cache(priv, start_of_rom, priv->header.rom_size,
 			     priv->header.align);
 	if (priv->result == CBFS_SUCCESS)
-		priv->initialized = 1;
+		priv->initialized = true;
 }
 
 void file_cbfs_init(ulong end_of_rom)
@@ -244,7 +244,7 @@  int cbfs_init_mem(ulong base, ulong size, struct cbfs_priv **privp)
 	if (priv->result != CBFS_SUCCESS)
 		return -EINVAL;
 
-	priv->initialized = 1;
+	priv->initialized = true;
 	priv = malloc(sizeof(priv_s));
 	if (!priv)
 		return -ENOMEM;