Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2551427imu; Thu, 29 Nov 2018 06:46:48 -0800 (PST) X-Google-Smtp-Source: AFSGD/U6vA9QXOP/FRNgqm98NkivrHVMGrHWdCkIwvp1JSlkBJgb3pr08496xZrPc+eXRj2a4LEP X-Received: by 2002:a17:902:6909:: with SMTP id j9mr1695685plk.196.1543502808643; Thu, 29 Nov 2018 06:46:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543502808; cv=none; d=google.com; s=arc-20160816; b=K1KcqJGRyyTzzKgSkCLsyFv3fpX6NTN4XM4MD8iyNLD0C4s9hz2swRuEn+v2gCq8h2 lBfoe5TKDaMu9LOhFyEnBUruV7C6qKF+p6zDLwXoy6mezvgxdZ8qVd6u96FT4L86q3vb kPkzwgOXBstzwlGH/QxZYkg0whKCTV5FkN9a/KSBOo1J1hPQaoEuznKZpx4FReo5scC/ HVVjKueh6o3gssvd7I/cKs0QCUA9l4YGjhXPcdqZihvMZobQYssXThx7cn2I/XsPDgq8 69lVrCeM+/NdPrt09KnTkjuY955nzhEsbObzEI4xC2fAKO+PNSLCCMwDmO+qaa7HkJGX G3HQ== 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=qNHWyeWdvr+4n3MyloUNLJh2Z0j+++SfH2+4Sey1U9U=; b=vKEsf4dTV7eGfLHCjNIT7bfPCNLoifZipPtza3XNa1uQdstNRsyWSf+ptUNSb6j1KM WwSSNs74+eTBk1Gdj6ekcmffqow84w/k2Tl3aeJk5Ybn6DE0VX99+VQtMqK+52PQUibQ 5MLd8zUR+wue6UrZFRXSBgai5o20hyYKtcqtALeogium5df3WNNlBluPxoX1hq2iy5Ce Uj2nL5RmGEyUaIJ3AoQS06pqf80HmLHGTMGNOQiS2IzKEIzkj+UP4wKPjoEchpaCdZmM idayGrMV119dQGv1yCaRBOQnlemUrR9Cy3Av/RiDG1/KFdY8tLIGMe0vI7vnlIfYOGPF guqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nDHZvdaH; 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 e125si2467451pfe.14.2018.11.29.06.46.33; Thu, 29 Nov 2018 06:46:48 -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=nDHZvdaH; 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 S2387631AbeK3Bcs (ORCPT + 99 others); Thu, 29 Nov 2018 20:32:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:32970 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731824AbeK3Bcs (ORCPT ); Thu, 29 Nov 2018 20:32:48 -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 E3B162146D; Thu, 29 Nov 2018 14:27:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543501635; bh=yvV7btENu/TvnNVwX0IHII75Ocl71bzCa2JZ+Hg3bOE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nDHZvdaHvOxuEfRq4zj8x5yDfYZiP/IgM8Dz7mF1MoIEbSkPqmjYLnoN1r/MVhhFb jS3+sHhKYKI5hJ8xxBv0tjz4et+PAOh2GOG/DHD9+u34GLUnQuhNoKdFpv2ir4bybB IWTVEG17i9mMhoHqq9dlIyz0umF4P1mlxlQ1RVkE= 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.14 077/100] Input: xpad - avoid using __set_bit() for capabilities Date: Thu, 29 Nov 2018 15:12:47 +0100 Message-Id: <20181129140105.427259402@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129140058.768942700@linuxfoundation.org> References: <20181129140058.768942700@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.14-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 7e812a8877bc..69b44aebaf01 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -1581,8 +1581,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: @@ -1601,6 +1599,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; } } @@ -1641,10 +1642,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]); @@ -1652,21 +1650,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]); } /* @@ -1683,7 +1682,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