maple_tree: modified return type of mas_wr_store_entry()
Subsystems (3)
PATCH v3 1/1 maple_tree: modified return type of mas_wr_store_entry()
Since the return value of mas_wr_store_entry() is not used, the return type can be changed to void.
Signed-off-by JaeJoon Jung <[email protected]>
--- lib/maple_tree.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)
lib/maple_tree.c +6 -9
@@ -4203,31 +4203,28 @@ static inline void mas_wr_modify(struct ma_wr_state *wr_mas)* * Return: The contents that was stored at the index. */ -static inline void *mas_wr_store_entry (struct ma_wr_state *wr_mas) +static inline void mas_wr_store_entry (struct ma_wr_state *wr_mas) {struct ma_state *mas = wr_mas->mas; wr_mas->content =mas_start (mas);if (mas_is_none (mas) ||mas_is_ptr (mas)) {mas_store_root (mas, wr_mas->entry); -return wr_mas->content; +return ; }if (unlikely (!mas_wr_walk (wr_mas))) {mas_wr_spanning_store (wr_mas); -return wr_mas->content; +return ; }/* At this point, we are at the leaf node that needs to be altered. */ mas_wr_end_piv (wr_mas);/* New root for a single pointer */ -if (unlikely (!mas->index && mas->last ==ULONG_MAX )) { +if (unlikely (!mas->index && mas->last ==ULONG_MAX ))mas_new_root (mas, wr_mas->entry); -return wr_mas->content; - } - -mas_wr_modify (wr_mas); -return wr_mas->content; +else +mas_wr_modify (wr_mas); }/**
Signature · 1 line
2.17.1
Quoted 4 lines · JaeJoon Jung
Since the return value of
mas_wr_store_entry()is not used, the return type can be changed to void.Signed-off-by JaeJoon Jung <[email protected]>
Thanks, looks good!
Reviewed-by Liam R. Howlett <[email protected]>
Quoted 49 lines
--- lib/maple_tree.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)lib/maple_tree.c +6
-9@@ -4203,31 +4203,28 @@ static inline void mas_wr_modify(struct ma_wr_state *wr_mas)* * Return: The contents that was stored at the index. */ -static inline void *mas_wr_store_entry (struct ma_wr_state *wr_mas) +static inline void mas_wr_store_entry (struct ma_wr_state *wr_mas) {struct ma_state *mas = wr_mas->mas; wr_mas->content =mas_start (mas);if (mas_is_none (mas) ||mas_is_ptr (mas)) {mas_store_root (mas, wr_mas->entry); -return wr_mas->content; +return ; }if (unlikely (!mas_wr_walk (wr_mas))) {mas_wr_spanning_store (wr_mas); -return wr_mas->content; +return ; }/* At this point, we are at the leaf node that needs to be altered. */ mas_wr_end_piv (wr_mas);/* New root for a single pointer */ -if (unlikely (!mas->index && mas->last ==ULONG_MAX )) { +if (unlikely (!mas->index && mas->last ==ULONG_MAX ))mas_new_root (mas, wr_mas->entry); -return wr_mas->content; - } - -mas_wr_modify (wr_mas); -return wr_mas->content; +else +mas_wr_modify (wr_mas); }/** Signature · 1 line
2.17.1