From patchwork Fri May 26 15:40:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 9750709 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E1E0760209 for ; Fri, 26 May 2017 15:40:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D2F3327C2D for ; Fri, 26 May 2017 15:40:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C7DC4283E8; Fri, 26 May 2017 15:40:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 708CF27C2D for ; Fri, 26 May 2017 15:40:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934840AbdEZPko (ORCPT ); Fri, 26 May 2017 11:40:44 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:33972 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934834AbdEZPkn (ORCPT ); Fri, 26 May 2017 11:40:43 -0400 Received: by mail-pf0-f195.google.com with SMTP id w69so3613487pfk.1; Fri, 26 May 2017 08:40:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ToXSk9ttpPkCg78wPBpWZOfSHH/zN/PXInWNNpeHXeo=; b=OOnfBJaGBhZdhR1569Q2fwmvhMjncS6BbpJ0KLVqNPfWvl7qIrhlK6i3+xUnaN3CkL F5Kkj4/EFDI21c3l1HogAiF53v+J9w+peRVIyEHeYi0dY4HOug9nZcJj3M5dQIOhZLS4 +hM8/24Pfh65NzLp73BLxhR/FihM9QCO0aNfB7Oyaz/9VBrw/xbnLedtfat6lQZtot3x sAvLOJW7TWJxjkbo7UH29PwP2M9CzoapUhAvMI+Gwcxgg6jt9CTuQXw7WzKw7H4YNonl n4J0El4aRrCWqNdyMsUtYXHcxxgWNOJYNsdm8q6a3wJLmP7j+Za6fF6+7MOGYaZvZ+N8 6mUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ToXSk9ttpPkCg78wPBpWZOfSHH/zN/PXInWNNpeHXeo=; b=tBKtkPhLiZ3HTuUNRX1Ll175HuSQ4bhw9zvPV7J9v6qcUfmaRxojsC0u13uK3MgfTc WTw1NPhgtl2WPmPkupBVv/dGZXo9PBdE47QZ8+4ZuPUlLtsZy6R9XbI1JrgghcadjwI9 zchPCqYY7VgMT2LLLmLxz5okegUrH1v4LngthVT/+/OsDBh9XfT4j5xVqrz+RegXX1tS 1s+RlRkf7Fne3s/3fHW78OwXetfTjFmLhCuKmYxjb3Cs7Ny6wUVwOqrKBMt52y0xMur2 05U9+YcMIyrl4fMRsBrp83COBNySH7MBesa6YOBbY8IoVzNN90LliaUs0DSejUGuzSbC 9gaw== X-Gm-Message-State: AODbwcDgYZlz4Rk8dZ8QC8v1JMvwiDoFoaaOrIujUIaVMZReeeYq+k19 Y3PuwEb8xf/3mQ== X-Received: by 10.84.232.205 with SMTP id x13mr58538365plm.7.1495813243096; Fri, 26 May 2017 08:40:43 -0700 (PDT) Received: from localhost.localdomain ([2601:647:4701:31a:320e:d5ff:febd:81c]) by smtp.googlemail.com with ESMTPSA id p89sm2972646pfk.67.2017.05.26.08.40.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 May 2017 08:40:42 -0700 (PDT) From: Nick Desaulniers Cc: gregkh@linuxfoundation.org, Nick Desaulniers , Dmitry Torokhov , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3] Input: mousedev - fix implicit conversion warning Date: Fri, 26 May 2017 08:40:28 -0700 Message-Id: <20170526154029.9405-1-nick.desaulniers@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170526153427.7830-1-nick.desaulniers@gmail.com> References: <20170526153427.7830-1-nick.desaulniers@gmail.com> To: unlisted-recipients:; (no To-header on input) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Clang warns: drivers/input/mousedev.c:653:63: error: implicit conversion from 'int' to 'signed char' changes value from 200 to -56 [-Wconstant-conversion] client->ps2[1] = 0x60; client->ps2[2] = 3; client->ps2[3] = 200; ~ ^~~ As far as I can tell, from http://www.computer-engineering.org/ps2mouse/ Under "Command Set" > "0xE9 (Status Request)" the value 200 is a valid sample rate. Using unsigned char, rather than signed char, for client->ps2 silences this warning. Signed-off-by: Nick Desaulniers --- * Additionally change function signature for the lone function dealing with ps2 data. drivers/input/mousedev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c index 0e0ff84088fd..0e31a109b1b4 100644 --- a/drivers/input/mousedev.c +++ b/drivers/input/mousedev.c @@ -103,7 +103,7 @@ struct mousedev_client { spinlock_t packet_lock; int pos_x, pos_y; - signed char ps2[6]; + unsigned char ps2[6]; unsigned char ready, buffer, bufsiz; unsigned char imexseq, impsseq; enum mousedev_emul mode; @@ -577,7 +577,7 @@ static inline int mousedev_limit_delta(int delta, int limit) } static void mousedev_packet(struct mousedev_client *client, - signed char *ps2_data) + unsigned char *ps2_data) { struct mousedev_motion *p = &client->packets[client->tail];