From patchwork Mon Sep 17 13:35:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: axel lin X-Patchwork-Id: 1466911 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id D8362DF2D8 for ; Mon, 17 Sep 2012 13:35:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751486Ab2IQNfl (ORCPT ); Mon, 17 Sep 2012 09:35:41 -0400 Received: from mail-oa0-f46.google.com ([209.85.219.46]:62235 "EHLO mail-oa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751319Ab2IQNfk (ORCPT ); Mon, 17 Sep 2012 09:35:40 -0400 Received: by oago6 with SMTP id o6so4711282oag.19 for ; Mon, 17 Sep 2012 06:35:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:content-type:x-mailer :content-transfer-encoding:mime-version; bh=au0NbUArJJc0uERx01C8gYN8FUU5rxSjhXtJkFt/TMs=; b=FQ2YEU2y5F41vAcEZ26o2xrmKCT9BZPmsX3I3JFH6Isa7vlfdsevc50KvWW5zKIULq ifx12zuiovX7II2HcgKcik80WUwYP8fWnBd8drikF+Nv75VPwhvlWhCZRQndO/9UFngH Tyr2eg/zgvMByuaS5jw2h20rdfatD2+zh9FNeKc8hPeHrJZMB8lxDfLxhmcPxLNVBXMX Co7EYrVHLl8LCygGn9bBBrew4Dp6F6MQkUQ7+FDqThsuNeYH3U+CtEPYHc+hRYL5Q9cF qSk4y+SoY0kMVZq34xBWZUm84zcO6OmfG5BbyUW4yQb/yPkImnabuINTBzqI2aEAS6Ao cI7w== Received: by 10.60.13.37 with SMTP id e5mr11264010oec.98.1347888940074; Mon, 17 Sep 2012 06:35:40 -0700 (PDT) Received: from [122.121.50.162] (122-121-50-162.dynamic.hinet.net. [122.121.50.162]) by mx.google.com with ESMTPS id c6sm10690838obd.22.2012.09.17.06.35.37 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 17 Sep 2012 06:35:39 -0700 (PDT) Message-ID: <1347888932.7521.2.camel@phoenix> Subject: [PATCH] HID: cypress: Use swap macro From: Axel Lin To: Jiri Kosina Cc: Jiri Slaby , linux-input@vger.kernel.org Date: Mon, 17 Sep 2012 21:35:32 +0800 X-Mailer: Evolution 3.2.3-0ubuntu6 Mime-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org This simplify the implementation. Signed-off-by: Axel Lin --- 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 3e159a5..3b795a2 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 + 1], rdesc[i + 3]); } return rdesc; }