From: Fabian Frederick Date: Wed, 10 Jun 2015 16:32:44 +0000 (-0300) Subject: [media] ttusb-dec: use swap() in swap_bytes() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=41cc14ba11d7d8532ef4f615c39eb6ebdcdeef61;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [media] ttusb-dec: use swap() in swap_bytes() Use kernel.h macro definition. Thanks to Julia Lawall for Coccinelle scripting support. Signed-off-by: Fabian Frederick Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/usb/ttusb-dec/ttusb_dec.c b/drivers/media/usb/ttusb-dec/ttusb_dec.c index 322b53a4f1dd..7c3a7c55d969 100644 --- a/drivers/media/usb/ttusb-dec/ttusb_dec.c +++ b/drivers/media/usb/ttusb-dec/ttusb_dec.c @@ -593,14 +593,9 @@ static void ttusb_dec_process_packet(struct ttusb_dec *dec) static void swap_bytes(u8 *b, int length) { - u8 c; - length -= length % 2; - for (; length; b += 2, length -= 2) { - c = *b; - *b = *(b + 1); - *(b + 1) = c; - } + for (; length; b += 2, length -= 2) + swap(*b, *(b + 1)); } static void ttusb_dec_process_urb_frame(struct ttusb_dec *dec, u8 *b,