Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2518801imu; Thu, 29 Nov 2018 06:19:15 -0800 (PST) X-Google-Smtp-Source: AFSGD/WOYxkr2MTSXBxFtcKT0kjzX+HG6y8zmBWyULwFoqCrd0FRM32KzTEGJxZNV6OMmv55FA9s X-Received: by 2002:a63:4a4d:: with SMTP id j13mr1419609pgl.127.1543501155644; Thu, 29 Nov 2018 06:19:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543501155; cv=none; d=google.com; s=arc-20160816; b=X45MOJtY6aFghS/7pV9HongpCjrniGGES4GOZw1Gsg5b5wPodaiQXPrz3z4RLDzlkd CvjrIX45oegrGokpfKUsBfGvTsS1HlcGNwlto/EhHs02Iupb3pFQp32O4uQvp3dUrhht e4F2XH6M6e4Urw+FQxkkwcXPEXVwkkoGKlVoJa61A9FSHVJWnr6sTx9yV9beLngWY35B No6SW1HlJBo2Q60du5M/mXWJeuLQb8sdkHkhOFu3Zcv/jdh0vLDLwiY/U7mLuiIofQEz uvvNDOLFewQhkXsxIhI0FrNwvxxadWSKL/4h5Gka++N2o1XgIxTl0bht4NvVY8/OOczL +fxQ== 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=tnIig5pb/BO6nCFq+0feHXwrCkHdz+IuzbhP+zt45JU=; b=jBONcEBqETSORP9EtKWwpdUHqVXIyHhRQwmjp+529q5sl3ULcO7wdic+8C2Bnes42F NmAXJVL1Iedq7I2jS+eEDQPpJJoT77wBie/VC2iDyN7xNLYTcDXc9j5JIbIhNohlu1z6 w9yPUR2PlZdNB5C9xuI117RvJcleN8pWnWbwvlqXplUcdEZaISKl5sPntxQteAFPkS9C pqI95+yZi7FRtlXEmjgEPdiE3S+4Wum6h5Y1IsqTQfGVb4MJ0+DSvvamC9Gx+tiLyvHe K/SwLDMIFYMNT7QKbM9zPmG9LBZEMUHNsZzo6SX33hTDkeHnCI8jtsuyGtXTIWWdwtdW UlRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UKPcOpq7; 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 b14si2287070pfc.156.2018.11.29.06.19.00; Thu, 29 Nov 2018 06:19:15 -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=UKPcOpq7; 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 S1729999AbeK3BVz (ORCPT + 99 others); Thu, 29 Nov 2018 20:21:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:43408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728865AbeK3BVy (ORCPT ); Thu, 29 Nov 2018 20:21:54 -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 5ABF2205C9; Thu, 29 Nov 2018 14:16:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543500983; bh=55f/FhRSEe1uRiYMk4VG1kxTFumTuz+RqAL5xJhk2aA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UKPcOpq7yBWOsQwe/5FtBK0CsivI7UPZ09l4PyfAxH5glRE3e80jIg+7YKVw4+lAi mn1jS0GfZ1oYonT9OT7oiyPRgV+kxFY1w6VcrYobyV09FFn//ClAGZ1q5Jn1ju77+y 9BRYym2FCh6hqt5KKPxotMwJkcUXr/ewJXczn9JQ= 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 3.18 71/83] Input: xpad - avoid using __set_bit() for capabilities Date: Thu, 29 Nov 2018 15:12:29 +0100 Message-Id: <20181129140141.888856811@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129140138.002176596@linuxfoundation.org> References: <20181129140138.002176596@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 3.18-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