From f957d5b78a0dd95920644682e995992277773efb Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 18 Mar 2021 10:40:35 +0000 Subject: of: overlay: Fix function name disparity Fixes the following W=1 kernel build warning(s): drivers/of/overlay.c:147: warning: expecting prototype for of_overlay_notifier_register(). Prototype was for of_overlay_notifier_unregister() instead Cc: Pantelis Antoniou Cc: Frank Rowand Cc: Rob Herring Cc: devicetree@vger.kernel.org Signed-off-by: Lee Jones Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20210318104036.3175910-10-lee.jones@linaro.org --- drivers/of/overlay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/of/overlay.c') diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index 50bbe0edf538..1c867a5e4c7c 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c @@ -140,7 +140,7 @@ int of_overlay_notifier_register(struct notifier_block *nb) EXPORT_SYMBOL_GPL(of_overlay_notifier_register); /** - * of_overlay_notifier_register() - Unregister notifier for overlay operations + * of_overlay_notifier_unregister() - Unregister notifier for overlay operations * @nb: Notifier block to unregister */ int of_overlay_notifier_unregister(struct notifier_block *nb) -- cgit From c4d74f0f978ed5ceee62cd3f6708081042e582a1 Mon Sep 17 00:00:00 2001 From: kernel test robot Date: Mon, 22 Mar 2021 19:21:39 +0100 Subject: of: overlay: fix for_each_child.cocci warnings Function "for_each_child_of_node" should have of_node_put() before goto. Generated by: scripts/coccinelle/iterators/for_each_child.cocci Fixes: 82c2d81361ec ("coccinelle: iterators: Add for_each_child.cocci script") CC: Sumera Priyadarsini Reported-by: kernel test robot Signed-off-by: kernel test robot Signed-off-by: Julia Lawall Reviewed-by: Frank Rowand Tested-by: Frank Rowand Link: https://lore.kernel.org/r/alpine.DEB.2.22.394.2103221918450.2918@hadrien Signed-off-by: Rob Herring --- drivers/of/overlay.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/of/overlay.c') diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index 1c867a5e4c7c..c25679f7bd3f 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c @@ -796,6 +796,7 @@ static int init_overlay_changeset(struct overlay_changeset *ovcs, if (!fragment->target) { of_node_put(fragment->overlay); ret = -EINVAL; + of_node_put(node); goto err_free_fragments; } -- cgit From 8c8239c2c1fb82f171cb22a707f3bb88a2f22109 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Thu, 25 Mar 2021 10:47:12 -0600 Subject: of: Add missing 'Return' section in kerneldoc comments Many of the DT kerneldoc comments are lacking a 'Return' section. Let's add the section in cases we have a description of return values. There's still some cases where the return values are not documented. Cc: Frank Rowand Cc: Mauro Carvalho Chehab Signed-off-by: Rob Herring Reviewed-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/20210325164713.1296407-8-robh@kernel.org --- drivers/of/overlay.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'drivers/of/overlay.c') diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index c25679f7bd3f..d241273170fd 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c @@ -298,7 +298,7 @@ err_free_target_path: * * Update of property in symbols node is not allowed. * - * Returns 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if + * Return: 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if * invalid @overlay. */ static int add_changeset_property(struct overlay_changeset *ovcs, @@ -403,7 +403,7 @@ static int add_changeset_property(struct overlay_changeset *ovcs, * * NOTE_2: Multiple mods of created nodes not supported. * - * Returns 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if + * Return: 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if * invalid @overlay. */ static int add_changeset_node(struct overlay_changeset *ovcs, @@ -475,7 +475,7 @@ static int add_changeset_node(struct overlay_changeset *ovcs, * * Do not allow symbols node to have any children. * - * Returns 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if + * Return: 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if * invalid @overlay_node. */ static int build_changeset_next_level(struct overlay_changeset *ovcs, @@ -606,7 +606,7 @@ static int find_dup_cset_prop(struct overlay_changeset *ovcs, * the same node or duplicate {add, delete, or update} properties entries * for the same property. * - * Returns 0 on success, or -EINVAL if duplicate changeset entry found. + * Return: 0 on success, or -EINVAL if duplicate changeset entry found. */ static int changeset_dup_entry_check(struct overlay_changeset *ovcs) { @@ -630,7 +630,7 @@ static int changeset_dup_entry_check(struct overlay_changeset *ovcs) * any portions of the changeset that were successfully created will remain * in @ovcs->cset. * - * Returns 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if + * Return: 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if * invalid overlay in @ovcs->fragments[]. */ static int build_changeset(struct overlay_changeset *ovcs) @@ -726,7 +726,7 @@ static struct device_node *find_target(struct device_node *info_node) * the top level of @tree. The relevant top level nodes are the fragment * nodes and the __symbols__ node. Any other top level node will be ignored. * - * Returns 0 on success, -ENOMEM if memory allocation failure, -EINVAL if error + * Return: 0 on success, -ENOMEM if memory allocation failure, -EINVAL if error * detected in @tree, or -ENOSPC if idr_alloc() error. */ static int init_overlay_changeset(struct overlay_changeset *ovcs, @@ -1181,7 +1181,7 @@ static int overlay_removal_is_ok(struct overlay_changeset *remove_ovcs) * If an error is returned by an overlay changeset post-remove notifier * then no further overlay changeset post-remove notifier will be called. * - * Returns 0 on success, or a negative error number. *ovcs_id is set to + * Return: 0 on success, or a negative error number. *ovcs_id is set to * zero after reverting the changeset, even if a subsequent error occurs. */ int of_overlay_remove(int *ovcs_id) @@ -1259,7 +1259,7 @@ EXPORT_SYMBOL_GPL(of_overlay_remove); * * Removes all overlays from the system in the correct order. * - * Returns 0 on success, or a negative error number + * Return: 0 on success, or a negative error number */ int of_overlay_remove_all(void) { -- cgit From aed4349c5d259c970f24dd8c84255ab8a5cd4a7d Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Wed, 21 Apr 2021 10:39:36 -0500 Subject: of: overlay: Fix kerneldoc warning in of_overlay_remove() '*ovcs_id' causes a warning because '*' is treated as bold markup: Documentation/devicetree/kernel-api:56: ../drivers/of/overlay.c:1184: WARNING: Inline emphasis start-string without end-string. Fix this by using the normal '@' markup for function parameters. That appears to be enough to keep the '*' from being interpretted as markup. Reported-by: Stephen Rothwell Cc: Frank Rowand Link: https://lore.kernel.org/r/20210421154548.1192903-1-robh@kernel.org/ Signed-off-by: Rob Herring --- drivers/of/overlay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/of/overlay.c') diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index d241273170fd..93af03c10e3b 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c @@ -1181,7 +1181,7 @@ static int overlay_removal_is_ok(struct overlay_changeset *remove_ovcs) * If an error is returned by an overlay changeset post-remove notifier * then no further overlay changeset post-remove notifier will be called. * - * Return: 0 on success, or a negative error number. *ovcs_id is set to + * Return: 0 on success, or a negative error number. *@ovcs_id is set to * zero after reverting the changeset, even if a subsequent error occurs. */ int of_overlay_remove(int *ovcs_id) -- cgit