Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1810658rwe; Fri, 2 Sep 2022 04:21:01 -0700 (PDT) X-Google-Smtp-Source: AA6agR5krwGRHp3qCRnBXjVw44N8PpED/k0XF7cqHM+0M0w6lNGs8FVhPRj68/LobWHoecowXCjM X-Received: by 2002:a17:906:5d04:b0:722:f46c:b891 with SMTP id g4-20020a1709065d0400b00722f46cb891mr26531539ejt.4.1662117660833; Fri, 02 Sep 2022 04:21:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662117660; cv=none; d=google.com; s=arc-20160816; b=bV8PCGHcQRMEbKYDQTkePdYQFWJ9ebXlWSlLmyRfnNdLOp9+FLIjPpiS28/anmlqnO KaCh805mTMeNh5HVKVEAdpPPLGnYkQVqh2E/QTaJT7dZ1dhRYiJd6IOrBjCfR8PBgEf2 EvxtQ4kcIMpbHGQGwBr/5pnqxigliGE94YsTTo4EdqNCpj1f/h6QsFAd1RBHm+XdEJCy dxhZxcuhYqoSmqtm1SdJ1JsnqBV8Q0V6gPoqTgNnifDmnPHQ58KDi6MzQPRTd+2xir7C PrNgXWmAw4h7CO6BGwCAQFDDoWRvpKzA/2Vyi13TvqJGUqDkTpRY1mSlak5sJ/tkwXlF oB3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=QhqAib3o4gxc+zDAACLxHtPW5HSoomv0U7U/Yy64YU0=; b=DhlD4kHX5n0FslgDnJ60TmrbPmdSrV42juUGwOPHWA8SaRHq0aP8P8NFMop9EyaqMH hJnUTvIqjXiq8hpfFHPpeH4ayLpGvDn4eWx7YhhNgsn3Fa58Cd8j6xr1eKd/eEkMB6AK Faarp87WzKPh0aGEyqpTPHZy+SFSG8LHOvuqRgNHMfMG08iNXkgbF/Pd0DdeKdAcX6cj 5N0tcvf4RiGH8BS6XbdMM+IKt5pkMq8OdDrVZuX+xfksdnaEVvY8PRweu3e9io8QLUBE RHSwuO6uIL/+ynkrmh82gIRjuYt+LoKygihZbW5f7Kmxeki/zvUiD79A+LQy6SWlsI0o mb8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b=E4at8mYV; 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 k22-20020a1709063fd600b0073d567769a9si1459399ejj.437.2022.09.02.04.20.30; Fri, 02 Sep 2022 04:21:00 -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; dkim=pass header.i=@digikod.net header.s=20191114 header.b=E4at8mYV; 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 S234195AbiIBLTc (ORCPT + 99 others); Fri, 2 Sep 2022 07:19:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232699AbiIBLTb (ORCPT ); Fri, 2 Sep 2022 07:19:31 -0400 X-Greylist: delayed 8079 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 02 Sep 2022 04:19:29 PDT Received: from smtp-42ab.mail.infomaniak.ch (smtp-42ab.mail.infomaniak.ch [84.16.66.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4E23C5790 for ; Fri, 2 Sep 2022 04:19:29 -0700 (PDT) Received: from smtp-3-0000.mail.infomaniak.ch (unknown [10.4.36.107]) by smtp-2-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4MJwRM65DLzMqHNX; Fri, 2 Sep 2022 13:19:27 +0200 (CEST) Received: from localhost (unknown [23.97.221.149]) by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4MJwRM3wNRz14M; Fri, 2 Sep 2022 13:19:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=digikod.net; s=20191114; t=1662117567; bh=wrXe8tHJ2UTJkif+PtnwYC1aVb7oXwurlcuWuM9Xqto=; h=From:To:Cc:Subject:Date:From; b=E4at8mYVC88+pzrWe1N+zAeX+4Q3k69MWep6fFn9EjP8ZtbfJYLaC0GmeyIoD6q6e naawFvOXMQUddwwcSY19BMa/Fk176n374yvbP2BD7ckLjJxD/dRt+xyQc9wN6DA+Io 2yiY/pYPeO9+l4AN6xw5XTrYaC1tl8gIWZobHM0o= From: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= To: Andy Whitcroft , Joe Perches Cc: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= , Dwaipayan Ray , Lukas Bulwahn , Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2] checkpatch: Handle FILE pointer type Date: Fri, 2 Sep 2022 13:19:23 +0200 Message-Id: <20220902111923.1488671-1-mic@digikod.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 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 When using a "FILE *" type, checkpatch considers this an error: ERROR: need consistent spacing around '*' (ctx:WxV) #32: FILE: f.c:8: +static void a(FILE *const b) ^ Fix this by explicitly defining "FILE" as a common type. This is useful for user space patches. With this patch, we now get: <_>WS( ) <_>IDENT(static) <_>WS( ) <_>DECLARE(void ) <_>FUNC(a) PAREN('(') <_>DECLARE(FILE *const ) <_>IDENT(b) <_>PAREN(')') -> V <_>WS( ) 32 > . static void a(FILE *const b) 32 > EEVVVVVVVTTTTTVNTTTTTTTTTTTTVVV 32 > ______________________________ Cc: Andy Whitcroft Cc: Dwaipayan Ray Cc: Joe Perches Cc: Lukas Bulwahn Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20220902111923.1488671-1-mic@digikod.net --- Changes since v1: https://lore.kernel.org/r/20220901145948.1456353-1-mic@digikod.net * Remove the FIXTURE_{DATA,VARIANT}() comments. * Improve commit description. --- scripts/checkpatch.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 79e759aac543..e2175102a354 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -576,10 +576,14 @@ our $typeKernelTypedefs = qr{(?x: (?:__)?(?:u|s|be|le)(?:8|16|32|64)| atomic_t )}; +our $typeStdioTypedefs = qr{(?x: + FILE +)}; our $typeTypedefs = qr{(?x: $typeC99Typedefs\b| $typeOtherOSTypedefs\b| - $typeKernelTypedefs\b + $typeKernelTypedefs\b| + $typeStdioTypedefs\b )}; our $zero_initializer = qr{(?:(?:0[xX])?0+$Int_type?|NULL|false)\b}; base-commit: b90cb1053190353cc30f0fef0ef1f378ccc063c5 -- 2.37.2