From patchwork Tue Jul 29 12:50:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolai Kondrashov X-Patchwork-Id: 4640371 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4ED569F32F for ; Tue, 29 Jul 2014 12:50:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 87F6F2011E for ; Tue, 29 Jul 2014 12:50:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF46820115 for ; Tue, 29 Jul 2014 12:50:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750960AbaG2MuW (ORCPT ); Tue, 29 Jul 2014 08:50:22 -0400 Received: from mail-we0-f172.google.com ([74.125.82.172]:36736 "EHLO mail-we0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750867AbaG2MuV (ORCPT ); Tue, 29 Jul 2014 08:50:21 -0400 Received: by mail-we0-f172.google.com with SMTP id x48so8878598wes.3 for ; Tue, 29 Jul 2014 05:50:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mQOaMmKrj70R+EHWziO2ELG3sOtAFG1h4g46ofMH0Po=; b=jKz+qBkzNScRI2OOunSTDhtNgRrWWVsrKLqhWoV8PRD8sKObiTBda2SIWN/qa4B5Wu ydeedxQCPSwUWECh707oLi8VmG9cyT48ijxLUYfT1KNWYG/2bSmY4uf5lGiadMMmm4RW XkvidTJelSaM2uugnN4LmmVJ+C66qEYDpdNz3FjtW60If1UVJmQ7l7ImLc7yPtCoKKHD HVe6TpUh6nk/TxHlEJWsmhO7LOnuNoSsFMBK7Knn+HziLS+6CyYKVCl6xI4Qcz5pVXDo NwmHZ6TMgaOlMWAyyLX0RRVzwpA4JYXcIqjkaStshtPwztwsCSu9cVatfP+tD5ol04EC zKOA== X-Received: by 10.180.98.165 with SMTP id ej5mr4453885wib.37.1406638216527; Tue, 29 Jul 2014 05:50:16 -0700 (PDT) Received: from gimli.redhat.com (a88-114-29-97.elisa-laajakaista.fi. [88.114.29.97]) by mx.google.com with ESMTPSA id 19sm57335758wjz.3.2014.07.29.05.50.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 29 Jul 2014 05:50:15 -0700 (PDT) From: Nikolai Kondrashov To: Jiri Kosina Cc: linux-input@vger.kernel.org, DIGImend-devel , Benjamin Tissoires , Nikolai Kondrashov Subject: [PATCH] hid: huion: Fix sparse warnings Date: Tue, 29 Jul 2014 15:50:06 +0300 Message-Id: <1406638206-6108-1-git-send-email-spbnick@gmail.com> X-Mailer: git-send-email 2.0.1 In-Reply-To: References: Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix sparse warnings in hid-huion.c by using correct buffer type for retrieved string descriptor. The warnings in question were: drivers/hid/hid-huion.c:144:44: sparse: cast to restricted __le16 drivers/hid/hid-huion.c:145:44: sparse: cast to restricted __le16 drivers/hid/hid-huion.c:146:51: sparse: cast to restricted __le16 drivers/hid/hid-huion.c:147:30: sparse: cast to restricted __le16 Signed-off-by: Nikolai Kondrashov --- Hi Jiri, Benjamin, Thanks for the review. There is one minor problem, though. I didn't run a sparse check and only just got a message with "sparse" warnings. This patch fixes them. If you wouldn't like adding a tiny patch like this, I can send another version of the original patches. Otherwise, please feel free to just fixup my "Switch to generating report descriptor" commit with this one. I'll try to remember to run sparse next time before submitting the patches. Thank you. Nick drivers/hid/hid-huion.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-huion.c b/drivers/hid/hid-huion.c index 438b54e..60f44cd 100644 --- a/drivers/hid/hid-huion.c +++ b/drivers/hid/hid-huion.c @@ -115,7 +115,7 @@ static int huion_tablet_enable(struct hid_device *hdev) int rc; struct usb_device *usb_dev = hid_to_usb_dev(hdev); struct huion_drvdata *drvdata = hid_get_drvdata(hdev); - u16 buf[6]; + __le16 buf[6]; /* * Read string descriptor containing tablet parameters. The specific