From patchwork Fri Apr 17 09:29:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 47274 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E3DCA2121F for ; Fri, 17 Apr 2015 09:30:07 +0000 (UTC) Received: by wiun10 with SMTP id n10sf2878504wiu.1 for ; Fri, 17 Apr 2015 02:30:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:message-id:date:from :user-agent:mime-version:to:references:in-reply-to:cc:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:content-type:content-transfer-encoding :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=AGgJa+3NCDyIkaJuUu/7BzjpKcJqqRj6GHlVMMktykU=; b=CU4+mMF8q6MpJ5csD5nmT9KuFWCowK6P0nmR77PWOFRelWHOeUnIElc1CxC8eRnNe9 3/xAegIoq3VZxJENFKQwjFobfU1J4UfJFaXYJSkBKSBz+h43BbdDo9OAWJSnE5fa2dqz 3zPq9spBELotr+IQUxczr/tPONe7/XhXnjRS9xN9Ut7XRvdztheKVuY7TZFYasYz+I2j zcBk91+CFFARodr2XZTNv6bJGdv2IAWGr1JXD6hkIMt5gCqZ1GMqFLrS7spS6jPSa8xG 1HO9r01sSfNourcz9+pmVbRQGEWXqJVT/Mjd/k9qr+RR+W+M+eeeBC22VXx4vDB0yDwk W1cg== X-Gm-Message-State: ALoCoQkLiJDWyYoPh9Ab1eNsiy8ZyAjp0VDMaj6kud8kxj0ZboEw5X1mtZ0Jw9ZLXmRpaBmM2Ppc X-Received: by 10.194.95.67 with SMTP id di3mr961158wjb.0.1429263007253; Fri, 17 Apr 2015 02:30:07 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.169 with SMTP id x9ls452816lal.92.gmail; Fri, 17 Apr 2015 02:30:07 -0700 (PDT) X-Received: by 10.153.4.43 with SMTP id cb11mr1807908lad.122.1429263007084; Fri, 17 Apr 2015 02:30:07 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id rl7si8352087lac.80.2015.04.17.02.30.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Apr 2015 02:30:07 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by laat2 with SMTP id t2so75711066laa.1 for ; Fri, 17 Apr 2015 02:30:07 -0700 (PDT) X-Received: by 10.152.87.204 with SMTP id ba12mr1810688lab.35.1429263006947; Fri, 17 Apr 2015 02:30:06 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp3618400lbt; Fri, 17 Apr 2015 02:30:06 -0700 (PDT) X-Received: by 10.140.102.120 with SMTP id v111mr2172946qge.93.1429263005704; Fri, 17 Apr 2015 02:30:05 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id x193si11080978qha.67.2015.04.17.02.30.04; Fri, 17 Apr 2015 02:30:05 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id 98A876203B; Fri, 17 Apr 2015 09:30:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 5176162031; Fri, 17 Apr 2015 09:30:02 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id EC3B062035; Fri, 17 Apr 2015 09:29:59 +0000 (UTC) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com [209.85.215.51]) by lists.linaro.org (Postfix) with ESMTPS id AA7E362031 for ; Fri, 17 Apr 2015 09:29:58 +0000 (UTC) Received: by laat2 with SMTP id t2so75708215laa.1 for ; Fri, 17 Apr 2015 02:29:57 -0700 (PDT) X-Received: by 10.112.219.201 with SMTP id pq9mr1761271lbc.109.1429262996988; Fri, 17 Apr 2015 02:29:56 -0700 (PDT) Received: from [172.22.39.11] ([195.238.92.128]) by mx.google.com with ESMTPSA id nz1sm2288495lbb.44.2015.04.17.02.29.55 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Apr 2015 02:29:56 -0700 (PDT) Message-ID: <5530D293.8040204@linaro.org> Date: Fri, 17 Apr 2015 12:29:55 +0300 From: Taras Kondratiuk User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: "Savolainen, Petri (Nokia - FI/Espoo)" , Mike Holmes References: <1429190974-19730-1-git-send-email-mike.holmes@linaro.org> <552FBC08.6010501@linaro.org> In-Reply-To: X-Topics: patch Cc: lng-odp Subject: Re: [lng-odp] [PATCH] checkpatch: allow strings split across lines X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: taras.kondratiuk@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 We can update checkpatch.pl to ignore these cases On 04/17/2015 09:46 AM, Savolainen, Petri (Nokia - FI/Espoo) wrote: > I agree with Ola and Taras. Strings should not be broken, otherwise > those are hard to find. I think the kernel style has the same > recommendation. > > -Petri > > *From:*lng-odp [mailto:lng-odp-bounces@lists.linaro.org] *On Behalf Of > *ext Ola Liljedahl > *Sent:* Thursday, April 16, 2015 5:15 PM > *To:* Mike Holmes > *Cc:* lng-odp > *Subject:* Re: [lng-odp] [PATCH] checkpatch: allow strings split across > lines > > On 16 April 2015 at 15:50, Mike Holmes > wrote: > > On 16 April 2015 at 09:41, Taras Kondratiuk > wrote: > > On 04/16/2015 04:29 PM, Mike Holmes wrote: > > We have an 80 char limit that is frequently an issue for strings and we > just accept that we ignore the warning. > > Allow split strings so that there is a valid alternative > Thus the following example becomes a legal alternative to the > 80 chars > warning. > > printf("\nThread %u (id=%d core=%d) had %u sync_failures" > " in %u iterations\n", thread_num, > ..... > > > The reason to have an exception for printed strings length is to have > them in one line to be searchable in a codebase. > > In this example grep'ing for 'sync_failures in' won't find this string. > > The above format string would better be expressed as > > printf("\nThread %u (id=%d core=%d) had %u sync_failures in " > > "%u iterations\n", thread_num, > > E.g. break at a formatting directive. > > But grepping using regular expressions ("had .* sync_failures in .* > iterations") would still fail. > > So allowing for lines (with strings) longer than 80 chars is preferable. > > > As with Google you just take a portion of the string if you really > have an issue. > > I rarely include syntactic elements in a search, in the same way > that if you search for this string verbatim with he specific thread > id, core and number of failures set in the actual string seen on > stdout you would not find the code either. > > -- > > Mike Holmes > > Technical Manager - Linaro Networking Group > > Linaro.org ***│ *Open source software for > ARM SoCs > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > https://lists.linaro.org/mailman/listinfo/lng-odp > > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > https://lists.linaro.org/mailman/listinfo/lng-odp > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 57d0a24..d90394e 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -272,7 +272,9 @@ our $logFunctions = qr{(?x: [a-z0-9]+_(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)(?:_rateli WARN(?:_RATELIMIT|_ONCE|)| panic| - MODULE_[A-Z_]+ + MODULE_[A-Z_]+| + ODP_ASSERT|ODP_DBG|ODP_ERR|ODP_ABORT|ODP_LOG|ODP_PRINT| + printf )}; our $signature_tags = qr{(?xi: