Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1047416rwe; Thu, 1 Sep 2022 11:34:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR57othEu8mNTCZd+U8PymzEMB1tihiVya89S7CL9mz5Ir36GsGnVN8B0YnnB+ZSKYpXq8Uk X-Received: by 2002:a17:902:c613:b0:174:7a32:f76 with SMTP id r19-20020a170902c61300b001747a320f76mr24148590plr.165.1662057290845; Thu, 01 Sep 2022 11:34:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662057290; cv=none; d=google.com; s=arc-20160816; b=cF9SwTWc/O+FainR9TB4awaWflG6ZdiTGVT1u+jdSVwH4IIVG8/9KG9dpeOEC4bKR/ 0Tf6m4KwhlFOYjEL+zI0ssZ1vvd6gJka2uDAeo+1T4aKc8p3tuWM8w0gEhk0fCKzPeKF PRWqvblRaTrU4cqqjMjqPpg/F0GA6X8g1zdkikZRvskgmbFYKG7mtRYMNUzXZ1NuZijj TlV54ywlJZeq9HKKGCY+Rm4E+NSrDNUwPqTZeKRwQF7Sa+EV+AF3wMinzYqaHJOVuRJA lXGPatwn/jf+IPfSGff5GDAojBCvG/PVpCPAGDTMABMKnT6vzdBD4GHsk9C4nDC/dcrz 6Oew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=nYrQo1DbeMJLuuq+05WwPbn13zGeSQk9BzwuSGal6OQ=; b=W8wctVaCeVqpAaFM1SzThzkTgidxDc/Ei0W8J0PD9kk8mfIeCSSRv3uZEmy3xDUkE8 RmzLqOlVsaw9M4Tn8uz7rdY2U0IviCzszrfXugPC0vLySTzB+as2DqGRSffeu+6z+MTO MhnLVboVMECdzBtymNO+38rELejkSUBBpP+M6N7R/25pizEcAoGru3r+FfzI3TyISsw4 2BCjeYr1SLefuFUDPvLFWM9NQkUJvAeeD/Vw6jc0cttyC53Ie5mH8HwFcJJdGVCeELpq VTYTnB3lxndoTy9ECL63fp87M9A5jv1AdqbDjK+qfoQa+/LFv+IXY9Cbn4KGdu8kZ+Rm O7xQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e22-20020a63d956000000b0042b9bfe2b69si8908999pgj.162.2022.09.01.11.34.24; Thu, 01 Sep 2022 11:34:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232449AbiIASWl convert rfc822-to-8bit (ORCPT + 99 others); Thu, 1 Sep 2022 14:22:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232008AbiIASWj (ORCPT ); Thu, 1 Sep 2022 14:22:39 -0400 Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 267127C1F6; Thu, 1 Sep 2022 11:22:38 -0700 (PDT) Received: from omf01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 944CC140976; Thu, 1 Sep 2022 18:22:36 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf01.hostedemail.com (Postfix) with ESMTPA id 088A260018; Thu, 1 Sep 2022 18:22:34 +0000 (UTC) Message-ID: Subject: Re: [RFC PATCH v1] checkpatch: Handle FILE pointer type From: Joe Perches To: =?ISO-8859-1?Q?Micka=EBl_Sala=FCn?= , Andy Whitcroft Cc: Dwaipayan Ray , Lukas Bulwahn , Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Jerome Forissier Date: Thu, 01 Sep 2022 14:22:33 -0400 In-Reply-To: <4f958a0c7c0aa2fce613371348477c002aa58e90.camel@perches.com> References: <20220901145948.1456353-1-mic@digikod.net> <4f958a0c7c0aa2fce613371348477c002aa58e90.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.44.4 (3.44.4-1.fc36) MIME-Version: 1.0 X-Rspamd-Server: rspamout03 X-Rspamd-Queue-Id: 088A260018 X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Stat-Signature: aabajss4g3getbegx3b3irk4mhjrigwe X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1/ZVDONQtBCY6C8xUN1pjZq3eaTFxSEfyg= X-HE-Tag: 1662056554-387444 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2022-09-01 at 11:49 -0400, Joe Perches wrote: > On Thu, 2022-09-01 at 16:59 +0200, Micka?l Sala?n wrote: > > When using a "FILE *" type, checkpatch considers this an error. Fix > > this by explicitly defining "FILE" as a common type. > [] > > Another error may be throw when we use FIXTURE_{DATA,VARIANT}() structs, > > as defined in kselftest_harness.h . > [] > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > [] > > @@ -576,10 +576,17 @@ our $typeKernelTypedefs = qr{(?x: > > (?:__)?(?:u|s|be|le)(?:8|16|32|64)| > > atomic_t > > )}; > > +our $typeStdioTypedefs = qr{(?x: > > + FILE > > +)}; > > I'm fine with this. > > > +# our $typeKselftestHarnessTypedefs = qr{(?x: > > +# FIXTURE_(?:DATA|VARIANT)\($Ident\) > > +# )}; > > But not this. Random userspace typedefs should likely > be kept in some local version of checkpatch. > > Or maybe add a command line option like --additional_typedefs=. Oops. I forgot it already exists: --typedefsfile Read additional types from this file commit 75ad8c575a5ad105e2afc2051c68abceb9c65431 Author: Jerome Forissier Date: Mon May 8 15:56:00 2017 -0700 checkpatch: add --typedefsfile When using checkpatch on out-of-tree code, it may occur that some project-specific types are used, which will cause spurious warnings. Add the --typedefsfile option as a way to extend the known types and deal with this issue.