Re: [PATCH 1/1 linux-next] HID: use swap() in cp_report_fixup()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 10 Jun 2015, Fabian Frederick wrote:

> Use kernel.h macro definition.
> 
> Thanks to Julia Lawall for Coccinelle scripting support.
> 
> Signed-off-by: Fabian Frederick <fabf@xxxxxxxxx>

Applied to for-4.2/upstream. Thanks.

> ---
>  drivers/hid/hid-cypress.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/hid/hid-cypress.c b/drivers/hid/hid-cypress.c
> index c4ef3bc..1b764d1 100644
> --- a/drivers/hid/hid-cypress.c
> +++ b/drivers/hid/hid-cypress.c
> @@ -41,13 +41,9 @@ static __u8 *cp_report_fixup(struct hid_device *hdev, __u8 *rdesc,
>  
>  	for (i = 0; i < *rsize - 4; i++)
>  		if (rdesc[i] == 0x29 && rdesc[i + 2] == 0x19) {
> -			__u8 tmp;
> -
>  			rdesc[i] = 0x19;
>  			rdesc[i + 2] = 0x29;
> -			tmp = rdesc[i + 3];
> -			rdesc[i + 3] = rdesc[i + 1];
> -			rdesc[i + 1] = tmp;
> +			swap(rdesc[i + 3], rdesc[i + 1]);
>  		}
>  	return rdesc;
>  }

-- 
Jiri Kosina
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux