From patchwork Tue Dec 14 10:56:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian@zmc.proxad.net, Fainelli@zmc.proxad.net X-Patchwork-Id: 409531 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBEB0Qel014898 for ; Tue, 14 Dec 2010 11:00:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754755Ab0LNLAY (ORCPT ); Tue, 14 Dec 2010 06:00:24 -0500 Received: from zmc.proxad.net ([212.27.53.206]:46052 "EHLO zmc.proxad.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754669Ab0LNLAX (ORCPT ); Tue, 14 Dec 2010 06:00:23 -0500 Received: from localhost (localhost [127.0.0.1]) by zmc.proxad.net (Postfix) with ESMTP id D2299127FFE; Tue, 14 Dec 2010 12:00:21 +0100 (CET) X-Virus-Scanned: amavisd-new at X-Spam-Flag: NO X-Spam-Score: -3.949 X-Spam-Level: X-Spam-Status: No, score=-3.949 tagged_above=-10 required=2.8 tests=[ALL_TRUSTED=-1.8, AWL=0.450, BAYES_00=-2.599] autolearn=ham Received: from zmc.proxad.net ([127.0.0.1]) by localhost (zmc.proxad.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yAr3uorK8PrX; Tue, 14 Dec 2010 12:00:21 +0100 (CET) Received: from localhost.localdomain (alphacore.org [94.143.114.39]) by zmc.proxad.net (Postfix) with ESMTPSA id A7564126937; Tue, 14 Dec 2010 12:00:21 +0100 (CET) From: Florian@zmc.proxad.net, Fainelli@zmc.proxad.net To: jkosina@suse.cz Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Florian Fainelli Subject: [PATCH] HID: replace offsets values with their corresponding BTN_* defines Date: Tue, 14 Dec 2010 11:56:56 +0100 Message-Id: <1292324216-12627-1-git-send-email-ffainelli@freebox.fr> X-Mailer: git-send-email 1.5.6.5 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 14 Dec 2010 11:00:26 +0000 (UTC) diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index d8d372b..f505789 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -319,21 +319,21 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel switch (field->application) { case HID_GD_MOUSE: - case HID_GD_POINTER: code += 0x110; break; + case HID_GD_POINTER: code += BTN_MOUSE; break; case HID_GD_JOYSTICK: if (code <= 0xf) code += BTN_JOYSTICK; else code += BTN_TRIGGER_HAPPY; break; - case HID_GD_GAMEPAD: code += 0x130; break; + case HID_GD_GAMEPAD: code += BTN_GAMEPAD; break; default: switch (field->physical) { case HID_GD_MOUSE: - case HID_GD_POINTER: code += 0x110; break; - case HID_GD_JOYSTICK: code += 0x120; break; - case HID_GD_GAMEPAD: code += 0x130; break; - default: code += 0x100; + case HID_GD_POINTER: code += BTN_MOUSE; break; + case HID_GD_JOYSTICK: code += BTN_JOYSTICK; break; + case HID_GD_GAMEPAD: code += BTN_GAMEPAD; break; + default: code += BTN_MISC; } }