diff mbox series

[01/12] log: Add missing category names

Message ID 20200928004624.1652803-2-sjg@chromium.org
State New
Delegated to: Tom Rini
Headers show
Series Various minor patches | expand

Commit Message

Simon Glass Sept. 28, 2020, 12:46 a.m. UTC
Add some category names that were missed in recent changes. Update the
comment as a reminder.

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

 common/log.c  | 5 +++++
 include/log.h | 4 +++-
 2 files changed, 8 insertions(+), 1 deletion(-)

Comments

Heinrich Schuchardt Sept. 28, 2020, 1:41 a.m. UTC | #1
Am 28. September 2020 02:46:13 MESZ schrieb Simon Glass <sjg@chromium.org>:
>Add some category names that were missed in recent changes. Update the
>comment as a reminder.
>
>Signed-off-by: Simon Glass <sjg@chromium.org>
>---
>
> common/log.c  | 5 +++++
> include/log.h | 4 +++-
> 2 files changed, 8 insertions(+), 1 deletion(-)
>
>diff --git a/common/log.c b/common/log.c
>index 9a5f100da34..38336d84e3c 100644
>--- a/common/log.c
>+++ b/common/log.c
>@@ -21,6 +21,11 @@ static const char *log_cat_name[LOGC_COUNT -
>LOGC_NONE] = {
> 	"driver-model",
> 	"device-tree",
> 	"efi",
>+	"alloc",
>+	"sandbox",
>+	"bloblist",
>+	"devres",
>+	"acpi",
> };

Should we add a compile time check that the array size matches the number of non-uclass categories?

Best regards

Heinrich

> 
> static const char *log_level_name[LOGL_COUNT] = {
>diff --git a/include/log.h b/include/log.h
>index 2859ce1f2e7..00885004a36 100644
>--- a/include/log.h
>+++ b/include/log.h
>@@ -39,7 +39,9 @@ enum log_level_t {
> 
> /**
> * Log categories supported. Most of these correspond to uclasses (i.e.
>- * enum uclass_id) but there are also some more generic categories
>+ * enum uclass_id) but there are also some more generic categories.
>+ *
>+ * Remember to update log_cat_name[] after adding a new category.
>  */
> enum log_category_t {
> 	LOGC_FIRST = 0,	/* First part mirrors UCLASS_... */
diff mbox series

Patch

diff --git a/common/log.c b/common/log.c
index 9a5f100da34..38336d84e3c 100644
--- a/common/log.c
+++ b/common/log.c
@@ -21,6 +21,11 @@  static const char *log_cat_name[LOGC_COUNT - LOGC_NONE] = {
 	"driver-model",
 	"device-tree",
 	"efi",
+	"alloc",
+	"sandbox",
+	"bloblist",
+	"devres",
+	"acpi",
 };
 
 static const char *log_level_name[LOGL_COUNT] = {
diff --git a/include/log.h b/include/log.h
index 2859ce1f2e7..00885004a36 100644
--- a/include/log.h
+++ b/include/log.h
@@ -39,7 +39,9 @@  enum log_level_t {
 
 /**
  * Log categories supported. Most of these correspond to uclasses (i.e.
- * enum uclass_id) but there are also some more generic categories
+ * enum uclass_id) but there are also some more generic categories.
+ *
+ * Remember to update log_cat_name[] after adding a new category.
  */
 enum log_category_t {
 	LOGC_FIRST = 0,	/* First part mirrors UCLASS_... */