Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp100057ybx; Wed, 30 Oct 2019 11:59:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqwAtGg4d2+GFECvY5qbPqk7t/i7V29sQfjG9Ut4re/lC431uaafUoXlj210rySR8g0dV0c7 X-Received: by 2002:a50:f306:: with SMTP id p6mr1417652edm.284.1572461944936; Wed, 30 Oct 2019 11:59:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572461944; cv=none; d=google.com; s=arc-20160816; b=aSM6BPQ3Pmvyk4F042abWNHFdSqUwfdxUZnq142hAWr65Qd9cLL6h5fQMK+KXn6CUx M1BcPmpXhGG03XTQStsbRk8W1GsVR105mp6bypbNQ1OrYDT6apnoWX4ulgGIDTipcakq IarqKGtSwvQ0TOQLtQjs7jFj/OBd95bfKM41mbisteqOPpcpdCTM91SI0sQUH6WcX2Hg fIwKt7+YPhND/+8Km129eJpzrg2LmKt/vZf8s35u7Ff92Rc/EdtsnOe0fdp9QdpMXEeU 8gkDLSzqEC7FyxRQAbauGNH58lnn1klaAOvBySCRmeBZShwNjgv2ThO8KBV9WZdtdjuC +3jg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=nR6pLqKg7idEnAPl7clkA52AA+ry45sZ5nLO5OCXcO4=; b=wOwcBfJAlKVYWUAJQVYHt0dMUi8prn2nPZvjfeWK1ZLFugqTbvVyfTYkM16Y3j1m6Y fnHt23HV8fCgm+TWuyEdaGfH4+OmX4pcwti4ksp8/Uc+ncBc8LsjTabewLUKbWD57JnA pbBtZZ8Ae5RDc2uXavXjVyf8WJ8n59SU2ccXa4p7X2g14S8zn9ndurnh88eRSlVxWY+M xpAaJueYytQDE6IwIM52fGpTsF6smqExiVJlS+cfbWVFrJXynmCI/pXRIjyJQsrMzcmX Ks/IqMYgl+BAFl3iZin4COKPrZoTuNmGijKI2VYo7PUGAOqpyqAJTsSeJq8m4KslPuDX Kv3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OpBHO7ou; 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 q10si1798725eje.222.2019.10.30.11.58.41; Wed, 30 Oct 2019 11:59:04 -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=OpBHO7ou; 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 S1727563AbfJ3Q1o (ORCPT + 99 others); Wed, 30 Oct 2019 12:27:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:42144 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726261AbfJ3Q1o (ORCPT ); Wed, 30 Oct 2019 12:27:44 -0400 Received: from [172.20.52.151] (unknown [91.217.168.176]) (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 9A5E120717; Wed, 30 Oct 2019 16:27:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572452863; bh=SNeRKTTlIPVnDUCxC0bSPsIHj4Io4ehDm7wcAEYJjtk=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=OpBHO7ouoTeY0DhFV/9oJyVVEW4ok/e2kh/S/DlErORuYtBL2PonN7fC+EJQw0IcR 9PqqMkFDhj+eSzB+LqXckqjXLJh0R4adehDhmwWqf2tt9kkdfNS3EM0oqGSa7PVmbl /lfqcDbiawl2Xiu2I+wIKSAxBafBjIltvN6+DPAI= Subject: Re: [PATCH linux-kselftest/test v6] lib/list-test: add a test for the 'list' doubly linked list To: Dan Carpenter , David Gow Cc: Brendan Higgins , Andrew Morton , Kees Cook , "open list:KERNEL SELFTEST FRAMEWORK" , kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, shuah References: <20191024224631.118656-1-davidgow@google.com> <0cb1d948-0da3-eb0f-c58f-ae3a785dd0dd@kernel.org> <20191030104217.GA18421@kadam> From: shuah Message-ID: <42a8270d-ed6f-d29f-5e71-7b76a074b63e@kernel.org> Date: Wed, 30 Oct 2019 10:27:12 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191030104217.GA18421@kadam> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/30/19 4:42 AM, Dan Carpenter wrote: > On Wed, Oct 30, 2019 at 01:02:11AM -0700, David Gow wrote: >>> ERROR: that open brace { should be on the previous line >>> #869: FILE: lib/list-test.c:680: >>> +static void list_test_list_for_each_entry_reverse(struct kunit *test) >>> +{ >>> >>> >>> I am seeing these error and warns. As per our hallway conversation, the >>> "for_each*" in the test naming is tripping up checkpatch.pl >>> >>> For now you can change the name a bit to not trip checkpatch and maybe >>> explore fixing checkpatch to differentiate between function names >>> with "for_each" in them vs. the actual for_each usages in the code. >> >> Thanks, Shuah. >> >> Yes, the problem here is that checkpatch.pl believes that anything >> with "for_each" in its name must be a loop, so expects that the open >> brace is placed on the same line as for a for loop. >> >> Longer term, I think it'd be nicer, naming-wise, to fix or work around >> this issue in checkpatch.pl itself, as that'd allow the tests to >> continue to follow a naming pattern of "list_test_[x]", where [x] is >> the name of the function/macro being tested. Of course, short of >> trying to fit a whole C parser in checkpatch.pl, that's going to >> involve some compromises as well. > > Just make it a black list of the 5 most common for_each macros. > How does black listing work in the context of checkpatch.pl? >> >> In the meantime, I'm sending out v7 which replaces "for_each" with >> "for__each" (adding the extra underscore), so that checkpatch is >> happy. This change is required just to quiet checkpatch and I am not happy about asking for this change. At the same time, I am concerned about git hooks failing on this patch. > > It's better to ignore checkpatch and other scripts when they are wrong. > (unless the warning message inspires you to make the code more readable > for humans). > It gets confusing when to ignore and when not to. It takes work to figure out and it is subjective. It would be great if we can consistently rely on a tool that is used as a criteria for patches to accept patches. thanks, -- Shuah