ata: sata_sil: Remove useless BLK guard in sata_sil.h
[platform/kernel/u-boot.git] / common / bootstage.c
index 5f87358..0fd33be 100644 (file)
@@ -9,6 +9,8 @@
  * permits accurate timestamping of each.
  */
 
+#define LOG_CATEGORY   LOGC_BOOT
+
 #include <common.h>
 #include <bootstage.h>
 #include <hang.h>
@@ -16,6 +18,7 @@
 #include <malloc.h>
 #include <sort.h>
 #include <spl.h>
+#include <asm/global_data.h>
 #include <linux/compiler.h>
 #include <linux/libfdt.h>
 
@@ -126,12 +129,16 @@ ulong bootstage_add_record(enum bootstage_id id, const char *name,
 
        /* Only record the first event for each */
        rec = find_id(data, id);
-       if (!rec && data->rec_count < RECORD_COUNT) {
-               rec = &data->record[data->rec_count++];
-               rec->time_us = mark;
-               rec->name = name;
-               rec->flags = flags;
-               rec->id = id;
+       if (!rec) {
+               if (data->rec_count < RECORD_COUNT) {
+                       rec = &data->record[data->rec_count++];
+                       rec->time_us = mark;
+                       rec->name = name;
+                       rec->flags = flags;
+                       rec->id = id;
+               } else {
+                       log_warning("Bootstage space exhasuted\n");
+               }
        }
 
        /* Tell the board about this progress */
@@ -223,7 +230,7 @@ uint32_t bootstage_accum(enum bootstage_id id)
  * @param buf  Buffer to put name if needed
  * @param len  Length of buffer
  * @param rec  Boot stage record to get the name from
- * @return pointer to name, either from the record or pointing to buf.
+ * Return: pointer to name, either from the record or pointing to buf.
  */
 static const char *get_record_name(char *buf, int len,
                                   const struct bootstage_record *rec)
@@ -266,7 +273,7 @@ static int h_compare_record(const void *r1, const void *r2)
  * Add all bootstage timings to a device tree.
  *
  * @param blob Device tree blob
- * @return 0 on success, != 0 on failure.
+ * Return: 0 on success, != 0 on failure.
  */
 static int add_bootstages_devicetree(struct fdt_header *blob)
 {
@@ -348,7 +355,7 @@ void bootstage_report(void)
        }
        if (data->rec_count > RECORD_COUNT)
                printf("Overflowed internal boot id table by %d entries\n"
-                      "Please increase CONFIG_(SPL_)BOOTSTAGE_RECORD_COUNT\n",
+                      "Please increase CONFIG_(SPL_TPL_)BOOTSTAGE_RECORD_COUNT\n",
                       data->rec_count - RECORD_COUNT);
 
        puts("\nAccumulated time:\n");