From patchwork Thu Dec 8 00:17:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping Cheng X-Patchwork-Id: 9465477 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0AD4960512 for ; Thu, 8 Dec 2016 00:17:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16AC82842A for ; Thu, 8 Dec 2016 00:17:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09B2028599; Thu, 8 Dec 2016 00:17:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DD3A28533 for ; Thu, 8 Dec 2016 00:17:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933784AbcLHARt (ORCPT ); Wed, 7 Dec 2016 19:17:49 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:35049 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933854AbcLHARr (ORCPT ); Wed, 7 Dec 2016 19:17:47 -0500 Received: by mail-pg0-f68.google.com with SMTP id p66so24944213pga.2 for ; Wed, 07 Dec 2016 16:17:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=yZDikEGRv0Xeh6/S2mfMoIsnIqnh7wK0DY90F6lY1sE=; b=WwUyg3SdH87+qkbJkNmOkj9WicsgYgUlPni+NYcfncoIdj/7lW4tVBjIZLi7j5odZH vaAlOwK88qygs/7rSygwO/WFcTHK5EGxF0CtAfOc5JUQv4lWAt5kVqr7gucXb/GC/7Ul z0Tgo6YPFbaJDdfHCsWbUAjl2bYcFpkWm43Q8vz4d7ie4WF+cUs4UcTYeQms9GigPAvl yyK5z+m9dieX6sV9qrb0qigG1w1vLEffew5GF04cEwr6ty4TYF0lQPtJFEs8bb1ltisK j1z6rmjoSBgoM6HrpfDt1gN7m6Bg5cdga6JtMu/QW9O7bPEAOGNvs4+M9n0X5WoCZlqk XKBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=yZDikEGRv0Xeh6/S2mfMoIsnIqnh7wK0DY90F6lY1sE=; b=cQ2H5wWtayvVEpqbcG11mkaiSRg9plmln3ZsMEI4MlEzkodQQJsNkSTvfdnTwWg2lD fHwkrYCUsyfTRfrzOUdj3ah65Nr+gLDRD0JgMnkvuI8gdJJVc4ZD50/al+dY5I+4cQT8 9EBgcW3p79s3lqgKT6sreaRsMak7OYuwkj/A8Bd9a7OShS+wwuYXaXn853MYFM4lkHWO iqOWE2POZFYQpvKch8vRLpbRN6I8bqCfmlnb71z48JTWCgALyPyS1ZFnREKQg3h8cO6U ywS0Wqh4W9/pHj0nrXY7QpPNLQZl4a5Z95RS8kTMUNAsXQueUQ8uMQmteQ6E7xOsmC5y z2zA== X-Gm-Message-State: AKaTC03z+OYJgfoLMhR3topDUYMhGqs19oKbwLaSmzntgAq+WFlT6k2jWXR/CjdUxSCRGg== X-Received: by 10.98.139.157 with SMTP id e29mr69840774pfl.115.1481156266626; Wed, 07 Dec 2016 16:17:46 -0800 (PST) Received: from wacom-XPS-8500.corp.onewacom.com ([50.225.60.4]) by smtp.gmail.com with ESMTPSA id b71sm45088895pfj.62.2016.12.07.16.17.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Dec 2016 16:17:45 -0800 (PST) From: Ping Cheng X-Google-Original-From: Ping Cheng To: linux-input@vger.kernel.org Cc: jkosina@suse.cz, benjamin.tissoires@redhat.com, Ping Cheng , Ping Cheng Subject: [PATCH 1/4] HID: wacom: generic: Don't return a value for wacom_wac_event Date: Wed, 7 Dec 2016 16:17:28 -0800 Message-Id: <1481156248-5264-1-git-send-email-pingc@wacom.com> X-Mailer: git-send-email 2.7.4 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It is unnecessary to return a value since nothing is expecting a value from it. Signed-off-by: Ping Cheng --- drivers/hid/wacom.h | 2 +- drivers/hid/wacom_wac.c | 62 +++++++++++++++++++++---------------------------- 2 files changed, 28 insertions(+), 36 deletions(-) diff --git a/drivers/hid/wacom.h b/drivers/hid/wacom.h index b4800ea..d303e41 100644 --- a/drivers/hid/wacom.h +++ b/drivers/hid/wacom.h @@ -210,7 +210,7 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev, struct wacom_wac *wacom_wac); void wacom_wac_usage_mapping(struct hid_device *hdev, struct hid_field *field, struct hid_usage *usage); -int wacom_wac_event(struct hid_device *hdev, struct hid_field *field, +void wacom_wac_event(struct hid_device *hdev, struct hid_field *field, struct hid_usage *usage, __s32 value); void wacom_wac_report(struct hid_device *hdev, struct hid_report *report); void wacom_battery_work(struct work_struct *work); diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index f1ef3e1..f1c49a4 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -1582,7 +1582,7 @@ static void wacom_wac_pad_usage_mapping(struct hid_device *hdev, } } -static int wacom_wac_pad_event(struct hid_device *hdev, struct hid_field *field, +static void wacom_wac_pad_event(struct hid_device *hdev, struct hid_field *field, struct hid_usage *usage, __s32 value) { struct wacom *wacom = hid_get_drvdata(hdev); @@ -1598,23 +1598,21 @@ static int wacom_wac_pad_event(struct hid_device *hdev, struct hid_field *field, case WACOM_HID_WD_BATTERY_LEVEL: wacom_wac->hid_data.battery_capacity = value; wacom_wac->hid_data.bat_connected = 1; - return 0; + break; case WACOM_HID_WD_BATTERY_CHARGING: wacom_wac->hid_data.bat_charging = value; wacom_wac->hid_data.ps_connected = value; wacom_wac->hid_data.bat_connected = 1; - return 0; + break; case WACOM_HID_WD_TOUCHRINGSTATUS: - return 0; + break; default: input_event(input, usage->type, usage->code, value); break; } - - return 0; } static void wacom_wac_pad_pre_report(struct hid_device *hdev, @@ -1731,7 +1729,7 @@ static void wacom_wac_pen_usage_mapping(struct hid_device *hdev, } } -static int wacom_wac_pen_event(struct hid_device *hdev, struct hid_field *field, +static void wacom_wac_pen_event(struct hid_device *hdev, struct hid_field *field, struct hid_usage *usage, __s32 value) { struct wacom *wacom = hid_get_drvdata(hdev); @@ -1753,25 +1751,25 @@ static int wacom_wac_pen_event(struct hid_device *hdev, struct hid_field *field, wacom_wac->hid_data.inrange_state = value; if (!(features->quirks & WACOM_QUIRK_SENSE)) wacom_wac->hid_data.sense_state = value; - return 0; + return; case HID_DG_BATTERYSTRENGTH: wacom_wac->hid_data.battery_capacity = value; wacom_wac->hid_data.bat_connected = 1; break; case HID_DG_INVERT: wacom_wac->hid_data.invert_state = value; - return 0; + return; case HID_DG_ERASER: case HID_DG_TIPSWITCH: wacom_wac->hid_data.tipswitch |= value; - return 0; + return; case HID_DG_TOOLSERIALNUMBER: wacom_wac->serial[0] = (wacom_wac->serial[0] & ~0xFFFFFFFFULL); wacom_wac->serial[0] |= value; - return 0; + return; case WACOM_HID_WD_SENSE: wacom_wac->hid_data.sense_state = value; - return 0; + return; case WACOM_HID_WD_SERIALHI: wacom_wac->serial[0] = (wacom_wac->serial[0] & 0xFFFFFFFF); wacom_wac->serial[0] |= ((__u64)value) << 32; @@ -1783,7 +1781,7 @@ static int wacom_wac_pen_event(struct hid_device *hdev, struct hid_field *field, if (value >> 20 == 1) { wacom_wac->id[0] |= value & 0xFFFFF; } - return 0; + return; case WACOM_HID_WD_TOOLTYPE: /* * Some devices (MobileStudio Pro, and possibly later @@ -1793,50 +1791,48 @@ static int wacom_wac_pen_event(struct hid_device *hdev, struct hid_field *field, * up over time :( */ wacom_wac->id[0] |= value; - return 0; + return; case WACOM_HID_WD_OFFSETLEFT: if (features->offset_left && value != features->offset_left) hid_warn(hdev, "%s: overriding exising left offset " "%d -> %d\n", __func__, value, features->offset_left); features->offset_left = value; - return 0; + return; case WACOM_HID_WD_OFFSETRIGHT: if (features->offset_right && value != features->offset_right) hid_warn(hdev, "%s: overriding exising right offset " "%d -> %d\n", __func__, value, features->offset_right); features->offset_right = value; - return 0; + return; case WACOM_HID_WD_OFFSETTOP: if (features->offset_top && value != features->offset_top) hid_warn(hdev, "%s: overriding exising top offset " "%d -> %d\n", __func__, value, features->offset_top); features->offset_top = value; - return 0; + return; case WACOM_HID_WD_OFFSETBOTTOM: if (features->offset_bottom && value != features->offset_bottom) hid_warn(hdev, "%s: overriding exising bottom offset " "%d -> %d\n", __func__, value, features->offset_bottom); features->offset_bottom = value; - return 0; + return; } /* send pen events only when touch is up or forced out * or touch arbitration is off */ if (!usage->type || delay_pen_events(wacom_wac)) - return 0; + return; /* send pen events only when the pen is in/entering/leaving proximity */ if (!wacom_wac->hid_data.inrange_state && !wacom_wac->tool[0]) - return 0; + return; input_event(input, usage->type, usage->code, value); - - return 0; } static void wacom_wac_pen_pre_report(struct hid_device *hdev, @@ -1980,7 +1976,7 @@ static void wacom_wac_finger_slot(struct wacom_wac *wacom_wac, } } -static int wacom_wac_finger_event(struct hid_device *hdev, +static void wacom_wac_finger_event(struct hid_device *hdev, struct hid_field *field, struct hid_usage *usage, __s32 value) { struct wacom *wacom = hid_get_drvdata(hdev); @@ -2013,8 +2009,6 @@ static int wacom_wac_finger_event(struct hid_device *hdev, if (equivalent_usage == wacom_wac->hid_data.last_slot_field) wacom_wac_finger_slot(wacom_wac, wacom_wac->touch_input); } - - return 0; } static void wacom_wac_finger_pre_report(struct hid_device *hdev, @@ -2100,29 +2094,27 @@ void wacom_wac_usage_mapping(struct hid_device *hdev, features->device_type |= WACOM_DEVICETYPE_DIRECT; if (WACOM_PAD_FIELD(field)) - return wacom_wac_pad_usage_mapping(hdev, field, usage); + wacom_wac_pad_usage_mapping(hdev, field, usage); else if (WACOM_PEN_FIELD(field)) - return wacom_wac_pen_usage_mapping(hdev, field, usage); + wacom_wac_pen_usage_mapping(hdev, field, usage); else if (WACOM_FINGER_FIELD(field)) - return wacom_wac_finger_usage_mapping(hdev, field, usage); + wacom_wac_finger_usage_mapping(hdev, field, usage); } -int wacom_wac_event(struct hid_device *hdev, struct hid_field *field, +void wacom_wac_event(struct hid_device *hdev, struct hid_field *field, struct hid_usage *usage, __s32 value) { struct wacom *wacom = hid_get_drvdata(hdev); if (wacom->wacom_wac.features.type != HID_GENERIC) - return 0; + return; if (WACOM_PAD_FIELD(field)) - return wacom_wac_pad_event(hdev, field, usage, value); + wacom_wac_pad_event(hdev, field, usage, value); else if (WACOM_PEN_FIELD(field)) - return wacom_wac_pen_event(hdev, field, usage, value); + wacom_wac_pen_event(hdev, field, usage, value); else if (WACOM_FINGER_FIELD(field)) - return wacom_wac_finger_event(hdev, field, usage, value); - - return 0; + wacom_wac_finger_event(hdev, field, usage, value); } static void wacom_report_events(struct hid_device *hdev, struct hid_report *report)