util.c 497 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 2013 Google, Inc
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #include <common.h>
  7. #include <vsprintf.h>
  8. void dm_warn(const char *fmt, ...)
  9. {
  10. va_list args;
  11. va_start(args, fmt);
  12. vprintf(fmt, args);
  13. va_end(args);
  14. }
  15. void dm_dbg(const char *fmt, ...)
  16. {
  17. va_list args;
  18. va_start(args, fmt);
  19. vprintf(fmt, args);
  20. va_end(args);
  21. }
  22. int list_count_items(struct list_head *head)
  23. {
  24. struct list_head *node;
  25. int count = 0;
  26. list_for_each(node, head)
  27. count++;
  28. return count;
  29. }