From patchwork Fri May 11 23:01:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Simonov X-Patchwork-Id: 10395499 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 E274D60236 for ; Fri, 11 May 2018 23:02:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D6DAB28FEF for ; Fri, 11 May 2018 23:02:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB4D828FF5; Fri, 11 May 2018 23:02:46 +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=-2.6 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,FSL_HELO_FAKE,MAILING_LIST_MULTI, RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_TVD_MIME_EPI 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 28E8F28FEF for ; Fri, 11 May 2018 23:02:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751028AbeEKXCo (ORCPT ); Fri, 11 May 2018 19:02:44 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:43452 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750818AbeEKXCn (ORCPT ); Fri, 11 May 2018 19:02:43 -0400 Received: by mail-lf0-f66.google.com with SMTP id n18-v6so3601886lfh.10; Fri, 11 May 2018 16:02:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=duWRdmZtfJ/F79xC4JozUqsT8TgGgyT8sXYctCmUANs=; b=IXpdxrPY1pGWNLF2RWyhPECmuvIFkWi6nR0VnfSXxW2NARR8YHyoVYFhODT/7i3lrS F3lf6I3/T/9/IeD6Kh3vqHRNEcK6uObhQIVST5MT0AFjhXlBxgHVN8hC3u68pU15jvQ7 uyoCU6b/aXUlMGkdHrMfRWDNkXx4r/nX4VTuuKB4maRR+cxSkSiJwq0+hJE4sl/GMX2k PX9DibWPI1vyX892QpvrGpTbJOSyVAil/NKADTC5YCTRU1heXajhQDayaaMzXlMYKXm0 oXW1jg7egx/hiwXJajGJlPU1R2yuGwDjdZgUnU+tlNKijnRdhDm681yquo5rIMy9MMfB knAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=duWRdmZtfJ/F79xC4JozUqsT8TgGgyT8sXYctCmUANs=; b=N+S4XEiXLnB9lrYofTZtChUkVxWnS9Dbvg/CNXW34cl4UKh8esXU34mdSQZ4dzNhu2 DRhqrf17PhSdkbeM2Lz5HYYoVe92wTwP/3KmJ3iKh70Ml+OD3USqWO99B9WlMePFN+Wy /HB2GjkKYevyPhc7vntVGHniSK/iy8q4xhf0WpMZkITTwd8NW9FOC2zLTqPt60vaYPfN AHox93Brr6QS/nFKB7WbDQ7YqDd0RRi3cF28jBXFFu97Trpg75wu6Xskze6osO1/c27q l1SehdQJ3vPMxta2utEAM+MKKolt2icYZ8LFWKipMfztyB/Ao/B2Ia9z0VVIRAgP0/uF eaDA== X-Gm-Message-State: ALKqPwc7o2FACQ9BIFOB/Z4yfK3lRe8XILb7B80ky1/bdonNTmn/A0e0 qzc6PJhx2R3RyH6mdG9iMTQ= X-Google-Smtp-Source: AB8JxZrQ1d67g751GjHntGJPkM4Oqq4k1nlrCtyb3W4xbt07x0hVvxjUE1evQO8BFHVoEGOkMgc4qg== X-Received: by 2002:a2e:86d9:: with SMTP id n25-v6mr5132416ljj.18.1526079761953; Fri, 11 May 2018 16:02:41 -0700 (PDT) Received: from gmail.com ([91.197.185.249]) by smtp.gmail.com with ESMTPSA id a70-v6sm649851lfb.78.2018.05.11.16.02.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 May 2018 16:02:41 -0700 (PDT) Date: Sat, 12 May 2018 02:01:20 +0300 From: Nick Simonov To: Dmitry Torokhov Cc: rydberg@bitmath.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] input: fix coding style issues in input.c Message-ID: <20180511230120.GA23354@gmail.com> References: <1525874834-20432-1-git-send-email-nicksimonovv@gmail.com> <20180510003313.GD91762@dtor-ws> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180510003313.GD91762@dtor-ws> User-Agent: Mutt/1.5.24 (2015-08-30) 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 Wed, May 09, 2018 at 05:33:13PM -0700, Dmitry Torokhov wrote: > Hi NIck, > > On Wed, May 09, 2018 at 05:07:14PM +0300, Nick Simonov wrote: > > This is a patch to the input.c file that fixes > > up warning found by checkpatch.pl tool > > > > Signed-off-by: Nick Simonov > > --- > > drivers/input/input.c | 52 ++++++++++++++++++++++++++++++++------------------- > > 1 file changed, 33 insertions(+), 19 deletions(-) > > > > diff --git a/drivers/input/input.c b/drivers/input/input.c > > index 9785546..e18fdae 100644 > > --- a/drivers/input/input.c > > +++ b/drivers/input/input.c > > @@ -1,3 +1,4 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > /* > > * The input core > > * > > @@ -252,7 +253,8 @@ static int input_handle_abs_event(struct input_dev *dev, > > } > > > > /* Flush pending "slot" event */ > > - if (is_mt_event && mt && mt->slot != input_abs_get_val(dev, ABS_MT_SLOT)) { > > + if (is_mt_event && mt && mt->slot != > > + input_abs_get_val(dev, ABS_MT_SLOT)) { > > input_abs_set_val(dev, ABS_MT_SLOT, mt->slot); > > So now it is not immediately clear what is part of condition and what is > part of body. > > I am sorry to say, but with most of these changes the cure is worse than > the disease. If you were fixing the code and adjusted the affected lines > so they are under 80 columns limit that would be one thing, but just > reformatting for the sake of it is not really helpful. > > Thanks. > > -- > Dmitry Dmitry thanks for your comment. I deleted all my changes except one and prepare a new patch for it. In function input_set_capability when it go through default statment it is use hard coded function name "input_set_capability" in pr_err() call. I replace it using "%s" __func__ instead. From 2aef27ca4896b8d9e64fd1417965793acfba3653 Mon Sep 17 00:00:00 2001 From: Nick Simonov Date: Sat, 12 May 2018 01:24:47 +0300 Subject: [PATCH] input: replace hard coded string with __func__ in pr_err() Change hardcoded string "input_set_capability" in pr_err() function call, replace it with "%s" __func__ instead. Signed-off-by: Nick Simonov --- drivers/input/input.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/input/input.c b/drivers/input/input.c index 9785546..6365c19 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -1943,8 +1943,7 @@ void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int break; default: - pr_err("input_set_capability: unknown type %u (code %u)\n", - type, code); + pr_err("%s: unknown type %u (code %u)\n", __func__, type, code); dump_stack(); return; }