Skip to content

Commit 5dff92a

Browse files
gclementrobherring
authored andcommitted
of: reserved_mem: Fix placement of __free() annotation
The __free() annotation was incorrectly placed before the variable name instead of after it, which resulted in the following checkpatch errors: ERROR: need consistent spacing around '*' (ctx:WxV) + struct device_node __free(device_node) *target = of_parse_phandle(np, "memory-region", idx); ^ WARNING: function definition argument 'idx' should also have an identifier name + struct device_node __free(device_node) *target = of_parse_phandle(np, "memory-region", idx); As part of this cleanup, also remove the useless return statement flagged by checkpatch. Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com> Link: https://patch.msgid.link/20260107-mtd-memregion-v3-1-f9fc9107b992@bootlin.com Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
1 parent 0365ada commit 5dff92a

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/of/of_reserved_mem.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ static void __init fdt_reserved_mem_save_node(unsigned long node, const char *un
127127
fdt_init_reserved_mem_node(rmem);
128128

129129
reserved_mem_count++;
130-
return;
131130
}
132131

133132
static int __init early_init_dt_reserve_memory(phys_addr_t base,
@@ -747,7 +746,7 @@ int of_reserved_mem_region_to_resource(const struct device_node *np,
747746
if (!np)
748747
return -EINVAL;
749748

750-
struct device_node __free(device_node) *target = of_parse_phandle(np, "memory-region", idx);
749+
struct device_node *target __free(device_node) = of_parse_phandle(np, "memory-region", idx);
751750
if (!target || !of_device_is_available(target))
752751
return -ENODEV;
753752

0 commit comments

Comments
 (0)