From patchwork Sun Jul 5 02:48:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mazin Rezk X-Patchwork-Id: 11644085 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 48242913 for ; Sun, 5 Jul 2020 02:56:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2538120885 for ; Sun, 5 Jul 2020 02:56:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="DRV+xQmi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728233AbgGEC4k (ORCPT ); Sat, 4 Jul 2020 22:56:40 -0400 Received: from mail-40137.protonmail.ch ([185.70.40.137]:50288 "EHLO mail-40137.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728004AbgGEC4k (ORCPT ); Sat, 4 Jul 2020 22:56:40 -0400 X-Greylist: delayed 494 seconds by postgrey-1.27 at vger.kernel.org; Sat, 04 Jul 2020 22:56:38 EDT Date: Sun, 05 Jul 2020 02:48:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1593917302; bh=pmMW5RuvGxW1tpO1VhOI282KLL4Jyl1FTQA9xHHkje0=; h=Date:To:From:Reply-To:Subject:From; b=DRV+xQmisuiAsx1+Yha2dlCbDHytWWCnUPz0BqGWq+248/rATeQ+YR+wM2wyy+cVb coT2B9en+mgxOKUFdNKenoVW4CKQ9Q3czSpS/uCksg5QtgTMck0Tl4IY8Wn5LesWeC vY4tfGQgEokDWfOLTibNNYo8ByXWON5Ex4KcpnRs= To: "linux-input@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "jikos@kernel.org" , Benjamin Tissoires From: Mazin Rezk Reply-To: Mazin Rezk Subject: [PATCH] HID: logitech: Use HIDPP_RECEIVER_INDEX instead of 0xff Message-ID: MIME-Version: 1.0 X-Spam-Status: No, score=-0.2 required=7.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HK_RANDOM_REPLYTO shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mail.protonmail.ch Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Some parts of hid-logitech-dj explicitly referred to 0xff for the receiver index. This patch changes those references to the HIDPP_RECEIVER_INDEX definition. Signed-off-by: Mazin Rezk Reviewed-by: Filipe LaĆ­ns --- drivers/hid/hid-logitech-dj.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.27.0 diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c index 48dff5d6b605..a78c13cc9f47 100644 --- a/drivers/hid/hid-logitech-dj.c +++ b/drivers/hid/hid-logitech-dj.c @@ -1153,7 +1153,7 @@ static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev) if (!dj_report) return -ENOMEM; dj_report->report_id = REPORT_ID_DJ_SHORT; - dj_report->device_index = 0xFF; + dj_report->device_index = HIDPP_RECEIVER_INDEX; dj_report->report_type = REPORT_TYPE_CMD_GET_PAIRED_DEVICES; retval = logi_dj_recv_send_report(djrcv_dev, dj_report); kfree(dj_report); @@ -1175,7 +1175,7 @@ static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev, if (djrcv_dev->type == recvr_type_dj) { dj_report->report_id = REPORT_ID_DJ_SHORT; - dj_report->device_index = 0xFF; + dj_report->device_index = HIDPP_RECEIVER_INDEX; dj_report->report_type = REPORT_TYPE_CMD_SWITCH; dj_report->report_params[CMD_SWITCH_PARAM_DEVBITFIELD] = 0x3F; dj_report->report_params[CMD_SWITCH_PARAM_TIMEOUT_SECONDS] = @@ -1204,7 +1204,7 @@ static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev, memset(buf, 0, HIDPP_REPORT_SHORT_LENGTH); buf[0] = REPORT_ID_HIDPP_SHORT; - buf[1] = 0xFF; + buf[1] = HIDPP_RECEIVER_INDEX; buf[2] = 0x80; buf[3] = 0x00; buf[4] = 0x00;