Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp6022058ybn; Sun, 29 Sep 2019 10:37:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqxW65MUGBP0b54SHv2RE9wQnwqd6947LYA7oW9tdDBojqDWJ9/YYaWHbZ6s3029UbIDaPNW X-Received: by 2002:aa7:dc57:: with SMTP id g23mr15696239edu.38.1569778659906; Sun, 29 Sep 2019 10:37:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569778659; cv=none; d=google.com; s=arc-20160816; b=njstWl94q+sBWGULbnM5VN7JlyejrEpjKQYuurpbepU5K9A0voEDaXj+l53QJvDCZu oTmsU5ZGDb7B8BVVv7UFcDzs+tucSAkxOdJDRUq+x2sm9OGecWObjUlG+L2dUjsTtHdj QIDpwYqPNxlxzmM0hXHm9KEwvHG0E/RmEjBhFMv09gqLk6EgUWBMRRi6m4BwBSaR4tBO mzYaKtnO3G+EcHQN/s/khRmo5bPJgSs3tnxpYCEgzKCqIU7rKO3Lb/2u1DSRI19krp5q 65DbKrATolo7+WEjOHt1+AILuCavAAzeC5p+tNHDlVE02fHI+zrx4g6NYw7v4ApjoqRh gyJQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IC36//Fz4EUSv3Fcgza+fLpPHqERTZghXJHVXO+kQTM=; b=vCVqCs26FugcI19fsQnNG/bAhiFoSA+L5iQ3jB+dIhDCb0pZ34UbcblTh7R9qVCnts R6KIlM2lu7rYVKGCqaJMO0MQq9WT4WJY11tYBXob7+5JNfn2jMSOUWxCLzbjXS0WEtNV 8CpGzk7F2n2bSbAlgYN9BZ7U2AZsyn+XkArSzGjDY6xqFDVwr3uAYh5lScr/uMrsNVFS KSb4GKgUKu2Vxeli2+xq8m76Hcp0izVfoNvimmrN9H1hglcn97CnvN+yvP8RxhnWuK2+ 0AsS/jwUjAxL9s5QUBkovZ2DTlz4YH08jqpOJwbTK17SHTSoe67BeReH6gm2/S+wq2Rz WtRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=x1J2GpyO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x45si5496455edd.388.2019.09.29.10.37.16; Sun, 29 Sep 2019 10:37:39 -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=x1J2GpyO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730440AbfI2Res (ORCPT + 99 others); Sun, 29 Sep 2019 13:34:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:46676 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728809AbfI2Rej (ORCPT ); Sun, 29 Sep 2019 13:34:39 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8C7AB21D71; Sun, 29 Sep 2019 17:34:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569778478; bh=QPtqNeyMsNf02U0gseQ4oTIdZSRz1mT4OcfhwZov/V8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x1J2GpyOil9hXmxGva4HHAU3Kd+3g6QP75Ng6RQKTD4iEAWl0wLWylLwqOeA1rEv2 W3Or8ZjlMcacwwr4rj2qdmXah4QM2SKpbP2Ml2i9yCNBPfxS7o/qByG/r2maWmnZDH 2DjBlxSQAu6CzS6vi2Aw/skQ163OZiRT4fmh+knM= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jason Gerecke , Jason Gerecke , Aaron Armstrong Skomra , Jiri Kosina , Sasha Levin , linux-input@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 07/33] HID: wacom: Fix several minor compiler warnings Date: Sun, 29 Sep 2019 13:33:55 -0400 Message-Id: <20190929173424.9361-7-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190929173424.9361-1-sashal@kernel.org> References: <20190929173424.9361-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 5a2d5140c1f42..3038c975e417c 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c @@ -91,7 +91,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; @@ -152,7 +152,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; } @@ -2147,7 +2148,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 6f5c838f9d474..1df037e7f0b42 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -255,7 +255,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; @@ -576,7 +576,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