Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2567426imu; Thu, 29 Nov 2018 07:01:46 -0800 (PST) X-Google-Smtp-Source: AFSGD/U5Oz6HF8Sre74skfljeNzoWEqkfnY/WVNVilxtJ7nkf+kv2IJfb6kjTZ67/UmVy1B3sTQC X-Received: by 2002:a17:902:8f83:: with SMTP id z3mr1744538plo.328.1543503706885; Thu, 29 Nov 2018 07:01:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543503706; cv=none; d=google.com; s=arc-20160816; b=m71a1tdvbXFslCsJppNYanTU+0yLZBRK7U60riQuIXQCRMoSuqY0zx6Mjd7SIvvc7b +3ZbXg9BcRZgLCstPjUoLL8RRggqE+djdAiyDWoFDH9+BeRDzrtRNxX7EQbk2C1lNK9r vZXlwu8bAHbah5hBYuvuby7ilz8td84/ppfJ9sXQhkecnXUoZuB5DaRFD2HmhHIOMKr/ 1lcja6O66aR7Aqk59yF3/CTfI6Oz7DSNNYFGeTnRZzbGqx5sC7hnJq+1u8eQRT7Slpxt DFsVeTKbIB856+96gYal6vkI408jU/27agURkIZasBa+PYWaUboxKWm/3UaH/QePnSdJ P+RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WqR8DNpMzL9AG7FsGI3BSS9ztkh4qnCKw+qnIIG1+N0=; b=Gv8G5RLTgJrUJHyyhwejlt98s1bW1DV2xBhvJQ4oWAwoMrq2Vt2Ikz1lyb6C9GQa+C gXwTBzFfc9lkD0Tea8vgRrNZfRNKCoZTy0/k6y/qvCjBCCMWmDjXJMW4R4geTKpzHx5/ 6sLEC4FuzpXjX23AimCIh6r4Wvb/I5RqKwGbPYzF3EV6RvZAWilABgNUgphJZFsfQTOQ AWSUf8MoTxpr3/mB6nbnkGxOxusHcN2kVZBI7dcazY4pXJfjyzBA+zWxpTVH4FSW3Gl7 MD9LbO3XnvPqvCMgE3p1Xy7qYHNftjEuXSLNVfaqW7ydqk8FlchW/junuQIUMjphGcm5 KgsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hwbcClt3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v19si2305040pfa.80.2018.11.29.07.01.29; Thu, 29 Nov 2018 07:01:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hwbcClt3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731030AbeK3BYu (ORCPT + 99 others); Thu, 29 Nov 2018 20:24:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:47886 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729808AbeK3BYt (ORCPT ); Thu, 29 Nov 2018 20:24:49 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 723C4205C9; Thu, 29 Nov 2018 14:19:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543501157; bh=S5L9mBuwFALp62MwTQ+5DXdlWD6yHniINwx8UdVOX+Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hwbcClt3IZ6hC3SLGqaO5ESyoVBJhTTTB1mWB211Drk2i5RRZK/dfRml0vUQOxMvq MYCbiax17JZOq6G66Y871CgL0Eoz2NMLv9rs6cLr/oKIET0kPdcKsGqm/WFiU8pNnb G6UxuQGXx01QvF+gl3xAc2AVWSrxucK6pzTWu4r4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marcus Folkesson , Dmitry Torokhov , Sasha Levin Subject: [PATCH 4.4 65/86] Input: xpad - avoid using __set_bit() for capabilities Date: Thu, 29 Nov 2018 15:12:30 +0100 Message-Id: <20181129140115.410018788@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129140109.832117862@linuxfoundation.org> References: <20181129140109.832117862@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit a01308031c2647ed5f1c845104b73a8820a958a9 ] input_set_capability() and input_set_abs_param() will do it for you. Signed-off-by: Marcus Folkesson Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- drivers/input/joystick/xpad.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index b6e172f22c16..5bf85c43e6d9 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -1579,8 +1579,6 @@ static void xpad_set_up_abs(struct input_dev *input_dev, signed short abs) { struct usb_xpad *xpad = input_get_drvdata(input_dev); - set_bit(abs, input_dev->absbit); - switch (abs) { case ABS_X: case ABS_Y: @@ -1599,6 +1597,9 @@ static void xpad_set_up_abs(struct input_dev *input_dev, signed short abs) case ABS_HAT0Y: /* the d-pad (only if dpad is mapped to axes */ input_set_abs_params(input_dev, abs, -1, 1, 0, 0); break; + default: + input_set_abs_params(input_dev, abs, 0, 0, 0, 0); + break; } } @@ -1639,10 +1640,7 @@ static int xpad_init_input(struct usb_xpad *xpad) input_dev->close = xpad_close; } - __set_bit(EV_KEY, input_dev->evbit); - if (!(xpad->mapping & MAP_STICKS_TO_NULL)) { - __set_bit(EV_ABS, input_dev->evbit); /* set up axes */ for (i = 0; xpad_abs[i] >= 0; i++) xpad_set_up_abs(input_dev, xpad_abs[i]); @@ -1650,21 +1648,22 @@ static int xpad_init_input(struct usb_xpad *xpad) /* set up standard buttons */ for (i = 0; xpad_common_btn[i] >= 0; i++) - __set_bit(xpad_common_btn[i], input_dev->keybit); + input_set_capability(input_dev, EV_KEY, xpad_common_btn[i]); /* set up model-specific ones */ if (xpad->xtype == XTYPE_XBOX360 || xpad->xtype == XTYPE_XBOX360W || xpad->xtype == XTYPE_XBOXONE) { for (i = 0; xpad360_btn[i] >= 0; i++) - __set_bit(xpad360_btn[i], input_dev->keybit); + input_set_capability(input_dev, EV_KEY, xpad360_btn[i]); } else { for (i = 0; xpad_btn[i] >= 0; i++) - __set_bit(xpad_btn[i], input_dev->keybit); + input_set_capability(input_dev, EV_KEY, xpad_btn[i]); } if (xpad->mapping & MAP_DPAD_TO_BUTTONS) { for (i = 0; xpad_btn_pad[i] >= 0; i++) - __set_bit(xpad_btn_pad[i], input_dev->keybit); + input_set_capability(input_dev, EV_KEY, + xpad_btn_pad[i]); } /* @@ -1681,7 +1680,8 @@ static int xpad_init_input(struct usb_xpad *xpad) if (xpad->mapping & MAP_TRIGGERS_TO_BUTTONS) { for (i = 0; xpad_btn_triggers[i] >= 0; i++) - __set_bit(xpad_btn_triggers[i], input_dev->keybit); + input_set_capability(input_dev, EV_KEY, + xpad_btn_triggers[i]); } else { for (i = 0; xpad_abs_triggers[i] >= 0; i++) xpad_set_up_abs(input_dev, xpad_abs_triggers[i]); -- 2.17.1