From patchwork Tue Jan 21 22:42:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Schroer X-Patchwork-Id: 3520961 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E1073C02DC for ; Tue, 21 Jan 2014 22:42:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E6F4020109 for ; Tue, 21 Jan 2014 22:42:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DE8DB20107 for ; Tue, 21 Jan 2014 22:42:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753815AbaAUWmJ (ORCPT ); Tue, 21 Jan 2014 17:42:09 -0500 Received: from mail-ee0-f42.google.com ([74.125.83.42]:47158 "EHLO mail-ee0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751408AbaAUWmH (ORCPT ); Tue, 21 Jan 2014 17:42:07 -0500 Received: by mail-ee0-f42.google.com with SMTP id e49so4443550eek.29 for ; Tue, 21 Jan 2014 14:42:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=zno17FS/Pn6DQbLT6klfVfYw50v+GxUkUQUk22pc3D4=; b=pyVD7FH/Y2tBRtpOfH2NlrwM8R2mxsnBtvk1MKqIFvpAEYlcGI67778O+3MNNNNsf+ 95loBbnkSmM4SW/42791DvnpM815WVMn/hvvJP1+QFAPfh9OblSTc/RHJizFg4t987OG HQ6vut4IxiPjD4gE7+NwRQmxHCVdIy8uU5PumKoWNYiiAQjBorWeped7l+j1TEdsEvOO mqOWaN+hAM1EYu8lOi+ndq/TP0/5zw/X9w5t2GK67Q0GmvONG7HPem1AHpmv59ThLTEB 7Ta3qc6XssiC4oR/0G/rAKZ1YKhuRcqec3XGm1jTzk1JMR+iXc9Ynq69RZU5nt0RRrTi yEvw== X-Received: by 10.14.4.67 with SMTP id 43mr4278267eei.70.1390344125736; Tue, 21 Jan 2014 14:42:05 -0800 (PST) Received: from fedora.fritz.box (pC19F0483.dip0.t-ipconnect.de. [193.159.4.131]) by mx.google.com with ESMTPSA id w4sm19756805eef.20.2014.01.21.14.42.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Jan 2014 14:42:05 -0800 (PST) Date: Tue, 21 Jan 2014 23:42:03 +0100 From: Rob Schroer To: Joe Perches Cc: Dmitry Torokhov , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drivers/hid/wacom: fixed coding style issues Message-ID: <20140121224203.GA12427@fedora.fritz.box> References: <20140121195153.GA4198@fedora.fritz.box> <20140121200645.GC29615@core.coreip.homeip.net> <20140121202944.GA4554@fedora.fritz.box> <20140121211823.GD29615@core.coreip.homeip.net> <1390339554.31946.6.camel@joe-AO722> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1390339554.31946.6.camel@joe-AO722> User-Agent: Mutt/1.5.21 (2010-09-15) 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.3 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 On Tue, Jan 21, 2014 at 01:25:54PM -0800, Joe Perches wrote: > On Tue, 2014-01-21 at 13:18 -0800, Dmitry Torokhov wrote: > > On Tue, Jan 21, 2014 at 09:29:44PM +0100, Rob Schroer wrote: > > > As far as I can see, kstrtoXXX() might be an alternative, but I was just > > > fixing coding style issues, no need to break anything IMO. > > > > You could do the breaking in a follow up patch ;) > > Yes please. > > Include the breaking of multiple statements > into multiple lines too please like > > from: > case USB_DEVICE_ID_WACOM_GRAPHIRE_BLUETOOTH: > rep_data[0] = 0x03; rep_data[1] = 0x00; > > to: > case USB_DEVICE_ID_WACOM_GRAPHIRE_BLUETOOTH: > rep_data[0] = 0x03; > rep_data[1] = 0x00; > > Added a cosmetical linebreak, switched an occurence of sscanf to kstrtoint. Signed-off-by: Robin Schroer --- drivers/hid/hid-wacom.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 1.8.4.2 Well, I hope this works as intended. -- Robin -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c index ebcca0d..5daf80c 100644 --- a/drivers/hid/hid-wacom.c +++ b/drivers/hid/hid-wacom.c @@ -336,7 +336,8 @@ static void wacom_set_features(struct hid_device *hdev, u8 speed) switch (hdev->product) { case USB_DEVICE_ID_WACOM_GRAPHIRE_BLUETOOTH: - rep_data[0] = 0x03; rep_data[1] = 0x00; + rep_data[0] = 0x03; + rep_data[1] = 0x00; limit = 3; do { ret = hdev->hid_output_raw_report(hdev, rep_data, 2, @@ -404,7 +405,7 @@ static ssize_t wacom_store_speed(struct device *dev, struct hid_device *hdev = container_of(dev, struct hid_device, dev); int new_speed; - if (sscanf(buf, "%1d", &new_speed) != 1) + if (kstrtoint(buf, 10, &new_speed)) return -EINVAL; if (new_speed == 0 || new_speed == 1) {