Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2556785imu; Thu, 29 Nov 2018 06:51:58 -0800 (PST) X-Google-Smtp-Source: AFSGD/X8Nqwd7/598/g9UTN7iKD0n3z1aO6DBdTBgWVIb+Qaa/F5wDuFSI+K1z2jOyGPv/bDRzAQ X-Received: by 2002:a63:741:: with SMTP id 62mr1463943pgh.352.1543503118159; Thu, 29 Nov 2018 06:51:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543503118; cv=none; d=google.com; s=arc-20160816; b=Wr8r8C/4XzxzS8FbQ5icuQR7BTwfSRdilMs7J1vSjmO5bRgaFYrGLRyEdU/e9+h88H k8LqaX1AiacAIsvn0tzTOITlv+/YxjaJzFD7XYcThZHzip2gvtW6kGljDkshG2bCeKHX jrTymdzTfHTtT7ZkyB1RziC+P8z5dkoScplA2gV22cGTQdnfSnGU8FGTERi1R0Aa75wh K7VWofBVMMAzDzNzMEucqP9vZqvlKDsVygpBw50MoQurxjdiFCO3nkXsY5FXWFhgxfpZ GsejKlW+86zLuHgeKmRN60odC8dkQBGB52DppE/r/s5GjAxqwDjnQmMu15XGngoK0Qs5 f3oQ== 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=+sW1n2O3wdpmvUCcloVIdlip3DfkZrCsDrnkMpbfPkQ=; b=JC/xFhtLEaz50X1IAHR4oKRxo/L2DsVKwumj/bDy9Fg/sXRz9GxLx6LcNw+oYEp2s6 SKwValC4cMxVhiX+lx9LK/8XqhzHnI+OrKR+i+zzN3nh6Gy5/2ffDgRESieohzjtM4Dm oK8+/377nFvd369APQ1OphYs6O7fG4mqGift1plCtJa2KlgW+QSAqbuC3B0eRa8Do5yE TIB4FOjUupbE0DoYio3YDVJFo850QMAFzXKrxp30hS2Oc/pHHK3q7+q4wDomFU7b6XKW aleC5UkNVTtlZzaqB+TfKpJsJOrJ0bPXVDwG6XRwG38Cyx6TF5ClQ70nJbIPRJwS7N+v bxsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Z1oLLvFK; 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 d4si2336808pls.348.2018.11.29.06.51.35; Thu, 29 Nov 2018 06:51:58 -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=Z1oLLvFK; 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 S1732605AbeK3B3v (ORCPT + 99 others); Thu, 29 Nov 2018 20:29:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:56524 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731464AbeK3B3u (ORCPT ); Thu, 29 Nov 2018 20:29:50 -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 B9F9B21104; Thu, 29 Nov 2018 14:24:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543501458; bh=b/hs+YFynVpcg5hnH1mJxHBmNsrq2yNVMZ/EOWwthcM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z1oLLvFKD7RHRh3EC4XrWd1+BIwwpTpZmq5pYLWw0DFl5tzJW5dpYe+yR6Nx7HrNi lbqRVF2pNqX4qOqibKjucb/MijHvirdzlygx99xF7R5sCsK5Y/jBG7aViufd7jQKjw g0t4zXVM5vFa8+mzj+Jr7iLjMHdDi8v3doR7jyLY= 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.9 66/92] Input: xpad - avoid using __set_bit() for capabilities Date: Thu, 29 Nov 2018 15:12:35 +0100 Message-Id: <20181129140111.650471639@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129140106.520639693@linuxfoundation.org> References: <20181129140106.520639693@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.9-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