Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3391130ybp; Sun, 6 Oct 2019 10:54:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/ea1oeQ4Bflc7AlAfGS0c2KATlhhTLkDx94Vgk03XZ8Sd4UBFuYzke9XllCjEvdhCvdNp X-Received: by 2002:a17:906:7802:: with SMTP id u2mr20918772ejm.3.1570384467207; Sun, 06 Oct 2019 10:54:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570384467; cv=none; d=google.com; s=arc-20160816; b=GOM17eFCSBV+zfkv6aBWTUL41XFMkIbGWqoiCMyg2OPyRcT7z47U38wBZzKfHZDM1a xTs4BsH/ay9vl6cQ5WtASkZ6wTMnoKMyXnhn3BUKHdWcF5F0c4UGjS3NQMoAVWq1h/rW wbEoYB8mJNtWYt0OP4hTSQr/FGO+QaGdSA5k7DVfNUNPFlIjXTsszEx8M2H+SSFn0A8V A/4VcpvrrBD1/LEMJvqhspJjML62GGPO39hQlDPuMaykvAziHAIamGbD/Q/mQgmjqTDl HrMS+1jjfOXiQ8t/CVhiw0o33pS2Dte/wQeVwlCyspXLINqFUkTQRia138+5ox6JjpZL i/mQ== 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=WQU4RGUT6uFb8qf/FCWsi/nH0VQqJq2J070tBMjoXVc=; b=DrxvA96dI9zTNsHpPAUGbo7EmNlpqQOnfKuOAijwUulNHM8VyS8/pdolanlQN9zzB9 5VubnoavcwtqKYExxMWGEnlXGq8t+Nene9G/RtBQDfu41DRidH4H1ACZh4RfmOIwI9Q2 qKWusv5Dx5cwl7sVLYiJW1jR2xv8SeH32mkZnRDA0YW0D/JXxfhSFjg4E9vg9fvIOzHq ziyPp6xA6bHebYBNRCxpF6hfxzJQSWG7kVh82VS51uMsnbx5rcTLTAVqdBHkvyzkbrsI YxNr7REgfji+yIsN4krZJK6OxWhTKZc8D7eM35n8I1ANWnKTCckcvbEdSqE4hiogbUZF zcSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=StaAY6e8; 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 l1si5799376ejr.246.2019.10.06.10.54.03; Sun, 06 Oct 2019 10:54:27 -0700 (PDT) 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=StaAY6e8; 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 S1729030AbfJFRg5 (ORCPT + 99 others); Sun, 6 Oct 2019 13:36:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:35760 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730365AbfJFRgy (ORCPT ); Sun, 6 Oct 2019 13:36:54 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 614B42080F; Sun, 6 Oct 2019 17:36:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383413; bh=DSnlGAxhxB7SSX6XqT2FqtNxf7JUGJ/CRstIzZireiI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=StaAY6e86eJHWcdky0TgwRqwqeT5I1ZtyWNGcCsSi5WhLKoU2LStuiM4escgQxsZF E+BvGxWJhzMwaUmqInBldB+ltAhVBl4jY2RLku84PaBZfWEsQX5q5iEuhcLb/pXsKf 0S+RoqfQuTv1SxVlVRMA04JPL+wZ8z4E+UAMPpfo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jason Gerecke , Aaron Armstrong Skomra , Jiri Kosina , Sasha Levin Subject: [PATCH 5.2 096/137] HID: wacom: Fix several minor compiler warnings Date: Sun, 6 Oct 2019 19:21:20 +0200 Message-Id: <20191006171216.879540210@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171209.403038733@linuxfoundation.org> References: <20191006171209.403038733@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Jason Gerecke [ Upstream commit 073b50bccbbf99a3b79a1913604c656d0e1a56c9 ] Addresses a few issues that were noticed when compiling with non-default warnings enabled. The trimmed-down warnings in the order they are fixed below are: * declaration of 'size' shadows a parameter * '%s' directive output may be truncated writing up to 5 bytes into a region of size between 1 and 64 * pointer targets in initialization of 'char *' from 'unsigned char *' differ in signedness * left shift of negative value Signed-off-by: Jason Gerecke Reviewed-by: Aaron Armstrong Skomra Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/wacom_sys.c | 7 ++++--- drivers/hid/wacom_wac.c | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index 53bddb50aebaf..602219a8710d0 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c @@ -88,7 +88,7 @@ static void wacom_wac_queue_flush(struct hid_device *hdev, } static int wacom_wac_pen_serial_enforce(struct hid_device *hdev, - struct hid_report *report, u8 *raw_data, int size) + struct hid_report *report, u8 *raw_data, int report_size) { struct wacom *wacom = hid_get_drvdata(hdev); struct wacom_wac *wacom_wac = &wacom->wacom_wac; @@ -149,7 +149,8 @@ static int wacom_wac_pen_serial_enforce(struct hid_device *hdev, if (flush) wacom_wac_queue_flush(hdev, &wacom_wac->pen_fifo); else if (insert) - wacom_wac_queue_insert(hdev, &wacom_wac->pen_fifo, raw_data, size); + wacom_wac_queue_insert(hdev, &wacom_wac->pen_fifo, + raw_data, report_size); return insert && !flush; } @@ -2176,7 +2177,7 @@ static void wacom_update_name(struct wacom *wacom, const char *suffix) { struct wacom_wac *wacom_wac = &wacom->wacom_wac; struct wacom_features *features = &wacom_wac->features; - char name[WACOM_NAME_MAX]; + char name[WACOM_NAME_MAX - 20]; /* Leave some room for suffixes */ /* Generic devices name unspecified */ if ((features->type == HID_GENERIC) && !strcmp("Wacom HID", features->name)) { diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index 58719461850de..6be98851edca4 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -251,7 +251,7 @@ static int wacom_dtu_irq(struct wacom_wac *wacom) static int wacom_dtus_irq(struct wacom_wac *wacom) { - char *data = wacom->data; + unsigned char *data = wacom->data; struct input_dev *input = wacom->pen_input; unsigned short prox, pressure = 0; @@ -572,7 +572,7 @@ static int wacom_intuos_pad(struct wacom_wac *wacom) strip2 = ((data[3] & 0x1f) << 8) | data[4]; } - prox = (buttons & ~(~0 << nbuttons)) | (keys & ~(~0 << nkeys)) | + prox = (buttons & ~(~0U << nbuttons)) | (keys & ~(~0U << nkeys)) | (ring1 & 0x80) | (ring2 & 0x80) | strip1 | strip2; wacom_report_numbered_buttons(input, nbuttons, buttons); -- 2.20.1