[PATCH v3 5/5] Lib: sort.h: remove the size argument from the swap function

2019-04-02 Thread Andrey Abramov
Removes size argument from the swap function because: 1) It wasn't used. 2) Custom swap function knows what kind of objects it swaps, so it already knows their sizes. Signed-off-by: Andrey Abramov Reviewed by: George Spelvin --- arch/x86/kernel/unwind_orc.

[PATCH v3 4/5] ubifs: find.c: replace swap function with built-in one

2019-04-02 Thread Andrey Abramov
unction is now a waste of time as well as code. Signed-off-by: Andrey Abramov Reviewed by: George Spelvin --- v2->v3: nothing changed fs/ubifs/find.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/fs/ubifs/find.c b/fs/ubifs/find.c index f9646835b026..5deaae7fcead

[PATCH v3 3/5] ocfs2: dir, refcounttree, xattr: replace swap functions with built-in one

2019-04-02 Thread Andrey Abramov
mized" custom swap function is now a waste of time as well as code. Signed-off-by: Andrey Abramov Reviewed by: George Spelvin --- v2->v3: nothing changed fs/ocfs2/dir.c | 13 + fs/ocfs2/refcounttree.c | 13 +++-- fs/ocfs2/xattr.c| 15 +++ 3

[PATCH v3 2/5] powerpc: module_[32|64].c: replace swap function with built-in one

2019-04-02 Thread Andrey Abramov
me as well as code. Signed-off-by: Andrey Abramov Reviewed by: George Spelvin Acked-by: Michael Ellerman (powerpc) --- v2->v3: nothing changed arch/powerpc/kernel/module_32.c | 17 + arch/powerpc/kernel/module_64.c | 17 + 2 files changed, 2 insertions(+),

[PATCH v3 1/5] arch/arc: unwind.c: replace swap function with built-in one

2019-04-02 Thread Andrey Abramov
mized" custom swap function is now a waste of time as well as code. Signed-off-by: Andrey Abramov Reviewed by: George Spelvin Acked-by: Vineet Gupta --- v2->v3: nothing changed arch/arc/kernel/unwind.c | 20 ++-- 1 file changed, 2 insertions(+), 18 deletions(-) diff --g

[PATCH v3 0/5] simple sort swap function improvements

2019-04-02 Thread Andrey Abramov
nows what kind of objects it swaps, so it already knows their sizes. v1->v2: Only commit messages have changed to better explain the purpose of commits. (Thanks to George Spelvin and Greg KH) v2->v3: Patch #5 now completely removes the size argument Andrey Abramov

Re: [PATCH 5/5] Lib: sort.h: replace int size with size_t size in the swap function

2019-04-01 Thread Andrey Abramov
generate an additional EXTB instruction to promote to 32-bit int > with > sign extension before using the value. > > -Vineet George Spelvin wrote "So how about *deleting* the parameter instead? That simplifies everything.", and he is right, so I am just going to compl

[PATCH v2 5/5] Lib: sort.h: replace int size with size_t size in the swap function

2019-03-31 Thread Andrey Abramov
ly. Signed-off-by: Andrey Abramov Reviewed by: George Spelvin --- arch/x86/kernel/unwind_orc.c | 2 +- include/linux/sort.h | 2 +- kernel/jump_label.c | 2 +- lib/extable.c| 2 +- lib/sort.c | 6 +++--- 5 files changed, 7 insertions(+), 7 deletion

[PATCH v2 4/5] ubifs: find.c: replace swap function with built-in one

2019-03-31 Thread Andrey Abramov
unction is now a waste of time as well as code. Signed-off-by: Andrey Abramov Reviewed by: George Spelvin --- fs/ubifs/find.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/fs/ubifs/find.c b/fs/ubifs/find.c index f9646835b026..5deaae7fcead 100644 --- a/fs/ubifs/find.

[PATCH v2 3/5] ocfs2: dir, refcounttree, xattr: replace swap functions with built-in one

2019-03-31 Thread Andrey Abramov
mized" custom swap function is now a waste of time as well as code. Signed-off-by: Andrey Abramov Reviewed by: George Spelvin --- fs/ocfs2/dir.c | 13 + fs/ocfs2/refcounttree.c | 13 +++-- fs/ocfs2/xattr.c| 15 +++ 3 files changed, 7 inserti

[PATCH v2 2/5] powerpc: module_[32|64].c: replace swap function with built-in one

2019-03-31 Thread Andrey Abramov
me as well as code. Signed-off-by: Andrey Abramov Reviewed by: George Spelvin --- arch/powerpc/kernel/module_32.c | 17 + arch/powerpc/kernel/module_64.c | 17 + 2 files changed, 2 insertions(+), 32 deletions(-) diff --git a/arch/powerpc/kernel/module_32.c b/ar

[PATCH v2 1/5] arch/arc: unwind.c: replace swap function with built-in one

2019-03-31 Thread Andrey Abramov
mized" custom swap function is now a waste of time as well as code. Signed-off-by: Andrey Abramov Reviewed by: George Spelvin --- arch/arc/kernel/unwind.c | 20 ++-- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/arch/arc/kernel/unwind.c b/arch/arc/kernel/unwi

[PATCH v2 0/5] simple sort swap function improvements

2019-03-31 Thread Andrey Abramov
h doesn't match the size_t element size passed to sort() function itself. So change it to size_t. v1->v2: Only commit messages have changed to better explain the purpose of commits. (Thanks to George Spelvin and Greg KH) Andrey Abramov (5): arch/arc: unwind.c: replace swap function

Re: [PATCH 5/5] Lib: sort.h: replace int size with size_t size in the swap function

2019-03-31 Thread Andrey Abramov
30.03.2019, 23:17, "George Spelvin" : > On Sat, 30 Mar 2019 at 19:38:26 +0100 greh k-h wrote; >>  On Sat, Mar 30, 2019 at 07:43:53PM +0300, Andrey Abramov wrote: >>>  Replace int type with size_t type of the size argument >>>  in the swap function, also aff

[PATCH 5/5] Lib: sort.h: replace int size with size_t size in the swap function

2019-03-30 Thread Andrey Abramov
Replace int type with size_t type of the size argument in the swap function, also affect all its dependencies. Signed-off-by: Andrey Abramov --- arch/x86/kernel/unwind_orc.c | 2 +- include/linux/sort.h | 2 +- kernel/jump_label.c | 2 +- lib/extable.c| 2

[PATCH 4/5] ubifs: find.c: replace swap function with built-in one

2019-03-30 Thread Andrey Abramov
Replace swap_dirty_idx function with built-in one, because swap_dirty_idx does only a simple byte to byte swap. Signed-off-by: Andrey Abramov --- fs/ubifs/find.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/fs/ubifs/find.c b/fs/ubifs/find.c index f9646835b026

[PATCH 2/5] powerpc: module_[32|64].c: replace swap function with built-in one

2019-03-30 Thread Andrey Abramov
Replace relaswap with built-in one, because of relaswap does a simple byte to byte swap. Signed-off-by: Andrey Abramov --- arch/powerpc/kernel/module_32.c | 17 + arch/powerpc/kernel/module_64.c | 17 + 2 files changed, 2 insertions(+), 32 deletions(-) diff

[PATCH 3/5] ocfs2: dir, refcounttree, xattr: replace swap functions with built-in one

2019-03-30 Thread Andrey Abramov
Replace dx_leaf_sort_swap, swap_refcount_rec and swap_xe functions with built-in one, because they do only a simple byte to byte swap. Signed-off-by: Andrey Abramov --- fs/ocfs2/dir.c | 13 + fs/ocfs2/refcounttree.c | 13 +++-- fs/ocfs2/xattr.c| 15

[PATCH 1/5] arch/arc: unwind.c: replace swap function with built-in one

2019-03-30 Thread Andrey Abramov
Replace swap_eh_frame_hdr_table_entries with built-in one, because swap_eh_frame_hdr_table_entries does a simple byte to byte swap. Signed-off-by: Andrey Abramov --- arch/arc/kernel/unwind.c | 20 ++-- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/arch/arc

[PATCH 0/5] simple sort swap function usage improvements

2019-03-30 Thread Andrey Abramov
bsystem (after that only 3 files implement custom swap - arch/x86/kernel/unwind_orc.c, kernel/jump_label.c and lib/extable.c). Patch #5 replaces the int type with the size_t type of the size argument in the swap function. Andrey Abramov (5): arch/arc: unwind.c: replace swap function with built-in