ext4: use swap() in memswap()
Use kernel.h macro definition. Thanks to Julia Lawall for Coccinelle scripting support. Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
parent
bdf96838ae
commit
4b7e2db5c0
@ -31,14 +31,11 @@
|
|||||||
static void memswap(void *a, void *b, size_t len)
|
static void memswap(void *a, void *b, size_t len)
|
||||||
{
|
{
|
||||||
unsigned char *ap, *bp;
|
unsigned char *ap, *bp;
|
||||||
unsigned char tmp;
|
|
||||||
|
|
||||||
ap = (unsigned char *)a;
|
ap = (unsigned char *)a;
|
||||||
bp = (unsigned char *)b;
|
bp = (unsigned char *)b;
|
||||||
while (len-- > 0) {
|
while (len-- > 0) {
|
||||||
tmp = *ap;
|
swap(*ap, *bp);
|
||||||
*ap = *bp;
|
|
||||||
*bp = tmp;
|
|
||||||
ap++;
|
ap++;
|
||||||
bp++;
|
bp++;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user