[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PULL 05/20] mem: move nvdimm_device_list to utilities
From: |
Peter Maydell |
Subject: |
Re: [PULL 05/20] mem: move nvdimm_device_list to utilities |
Date: |
Fri, 3 Apr 2020 13:34:01 +0100 |
On Fri, 21 Feb 2020 at 03:37, David Gibson <address@hidden> wrote:
>
> From: Shivaprasad G Bhat <address@hidden>
>
> nvdimm_device_list is required for parsing the list for devices
> in subsequent patches. Move it to common utility area.
>
> Signed-off-by: Shivaprasad G Bhat <address@hidden>
> Reviewed-by: Igor Mammedov <address@hidden>
> Reviewed-by: David Gibson <address@hidden>
> Message-Id: <address@hidden>
> Signed-off-by: David Gibson <address@hidden>
> ---
> hw/acpi/nvdimm.c | 28 +---------------------------
> include/qemu/nvdimm-utils.h | 7 +++++++
> util/Makefile.objs | 1 +
> util/nvdimm-utils.c | 29 +++++++++++++++++++++++++++++
> 4 files changed, 38 insertions(+), 27 deletions(-)
> create mode 100644 include/qemu/nvdimm-utils.h
> create mode 100644 util/nvdimm-utils.c
Hi; I just found this commit as a result of running
a clean-includes pass on the tree...
> diff --git a/include/qemu/nvdimm-utils.h b/include/qemu/nvdimm-utils.h
> new file mode 100644
> index 0000000000..4b8b198ba7
> --- /dev/null
> +++ b/include/qemu/nvdimm-utils.h
> @@ -0,0 +1,7 @@
> +#ifndef NVDIMM_UTILS_H
> +#define NVDIMM_UTILS_H
> +
> +#include "qemu/osdep.h"
New files should have a comment block at the top giving
author/copyright/license info.
Header files should never include osdep.h.
> +
> +GSList *nvdimm_get_device_list(void);
> +#endif
> diff --git a/util/nvdimm-utils.c b/util/nvdimm-utils.c
> new file mode 100644
> index 0000000000..5cc768ca47
> --- /dev/null
> +++ b/util/nvdimm-utils.c
> @@ -0,0 +1,29 @@
> +#include "qemu/nvdimm-utils.h"
> +#include "hw/mem/nvdimm.h"
New .c files definitely need a license/copyright
comment block.
All .c files must include "qemu/osdep.h" as the
very first include.
Would somebody like to send a patch fixing this, please?
> +
> +static int nvdimm_device_list(Object *obj, void *opaque)
> +{
> + GSList **list = opaque;
> +
> + if (object_dynamic_cast(obj, TYPE_NVDIMM)) {
> + *list = g_slist_append(*list, DEVICE(obj));
> + }
> +
> + object_child_foreach(obj, nvdimm_device_list, opaque);
> + return 0;
> +}
thanks
-- PMM
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PULL 05/20] mem: move nvdimm_device_list to utilities,
Peter Maydell <=