Simon Glass | dd6ab88 | 2014-02-26 15:59:18 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2013 Google, Inc |
| 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0+ |
| 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <vsprintf.h> |
| 9 | |
| 10 | void dm_warn(const char *fmt, ...) |
| 11 | { |
| 12 | va_list args; |
| 13 | |
| 14 | va_start(args, fmt); |
| 15 | vprintf(fmt, args); |
| 16 | va_end(args); |
| 17 | } |
| 18 | |
| 19 | void dm_dbg(const char *fmt, ...) |
| 20 | { |
| 21 | va_list args; |
| 22 | |
| 23 | va_start(args, fmt); |
| 24 | vprintf(fmt, args); |
| 25 | va_end(args); |
| 26 | } |
| 27 | |
| 28 | int list_count_items(struct list_head *head) |
| 29 | { |
| 30 | struct list_head *node; |
| 31 | int count = 0; |
| 32 | |
| 33 | list_for_each(node, head) |
| 34 | count++; |
| 35 | |
| 36 | return count; |
| 37 | } |