Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp118934imn; Fri, 29 Jul 2022 01:29:20 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vgwtRlZP5gZyFM7GSe0vJcltUkhkRaoH6vvtoeJAHZfwugly+CRZoHCaCYjxkH45TWbn7G X-Received: by 2002:a17:907:a055:b0:72b:16dd:d485 with SMTP id gz21-20020a170907a05500b0072b16ddd485mr2060783ejc.435.1659083360528; Fri, 29 Jul 2022 01:29:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659083360; cv=none; d=google.com; s=arc-20160816; b=RAzjfBDzTgbxrj1ulT8+s1vA8eiFSc4KRSb89ur/wUq9D0ZYQsGQYUIoetAF3xg4NH 0VRUGUZ/SbqEDYgy02avkbU553bNzV4f3ErCU8E528vv2Ctq0OBLHMf1R+NCEs7Xdh8v abB+2GmUsBhzlBd+0MWsLRmm6xtkGXPuB6jTdkkET0X9//N+4rng+CwjNACv4xcEp9Vl 91rOb/bfFhB/68S9zLvZNXQj7/eXCgxylYi4KAXICt6flmZNZi1FiyQCvf1tZvKiUQKr HVyiA8Hb+3RehpLFdNJP4OED4j80xX8db7QF20YSaMzVV0badgouAuEWW+AMYrjKS0+p IwRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mqmf3dK10pAmUtA4NV8FpntCVfL6ASsOe6DbT7gp9jk=; b=Pbk1bYMERpSXUbh/ZdWNSri9PFEJAAzSUpKCa8zF0pe/psVdCZis9UJP9SgeJ+qNI4 9fYSak5t5pWWnIKy5C1jJHVR3jFOLjbZQaJbjpaQDmCmQcwN8bD23cckkX0SOAEy2DNV RbKdvGx+85lsBiirOQZhb8QF9F0dCRdGI0P8+iFw8Q5vCWM5igaEW3wQf3ot3pmT9zQv gyThpcoqcWSAd77WAEPFazlWcHbDqvhTbDeO+EtA4yzS3EKsg4oItcoDT5fvK+mJmRN8 8l5yLyPSM8taCmsuF2wUFmZp/0FR+SoLsAPBx3CRMp7s2mAIkX2Ro7/cCT85pgM9ZIBk 3zzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=z29jy6PI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e13-20020a056402190d00b0043a7983aeffsi3531979edz.61.2022.07.29.01.28.55; Fri, 29 Jul 2022 01:29:20 -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=@linuxfoundation.org header.s=korg header.b=z29jy6PI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234603AbiG2IFC (ORCPT + 99 others); Fri, 29 Jul 2022 04:05:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229784AbiG2IFB (ORCPT ); Fri, 29 Jul 2022 04:05:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83D8319C0E; Fri, 29 Jul 2022 01:04:59 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1ECB261B7A; Fri, 29 Jul 2022 08:04:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02DCBC433C1; Fri, 29 Jul 2022 08:04:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1659081898; bh=x5iwixgmr+VlHTq5scaZuKlrBeunluPiau3t1p/QL+s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=z29jy6PIELGGQT8XQSEzLMZZ5GLdTrUTDj7XQovl+Q/4gaRXiykfo/ePYeA1z/GN8 G8zBCFz0o/lX+RMFz6y6kP+HgOkPMf2cbgt713Nki676wrHFLvjWsTQPk5hmrgT7H/ g1nv7G+mLKURrlGg0ixEZOAWfgYbIFgAZyA/IZiM= Date: Fri, 29 Jul 2022 10:04:55 +0200 From: Greg Kroah-Hartman To: Olliver Schinagl Cc: Gary Guo , Miguel Ojeda , Miguel Ojeda , Linus Torvalds , rust-for-linux , Linux Kbuild mailing list , Linux Doc Mailing List , linux-kernel Subject: Re: [PATCH 00/13] [RFC] Rust support Message-ID: References: <20210414184604.23473-1-ojeda@kernel.org> <5c0bb1db-5589-32ca-ac22-4aafb3c15751@schinagl.nl> <20220728112114.0000003a@garyguo.net> <5bd688b0-7694-0a96-67e6-7137c018c9a5@schinagl.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5bd688b0-7694-0a96-67e6-7137c018c9a5@schinagl.nl> X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,URI_DOTEDU 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 On Thu, Jul 28, 2022 at 10:45:08PM +0200, Olliver Schinagl wrote: > Hey Greg, > > On 28-07-2022 14:09, Greg Kroah-Hartman wrote: > > On Thu, Jul 28, 2022 at 11:21:14AM +0100, Gary Guo wrote: > > > Rust requires braces around branches of if expression, and C doesn't. > > > So in kernel coding style you often have: > > > > > > if (condition) do_something(); > > > > That is not a valid kernel coding style, and our tools should catch this > > and prevent it from being added to the kernel tree. > Are you sure? I'm not sure if this isn't true today, but I've certainly seen > old code where this definitely was done. Was all of this cleaned up in the > last 2+ years? Given that I wrote about this back in 2002, and it was true then: https://www.linuxjournal.com/article/5780 and: https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.2.8887&rep=rep1&type=pdf that is not anything new at all. Yes, old code still survives that might not be correct, and some subsystems might have added code over time without the proper style, but our tools check that the above is not correct, you can check it yourself: $ cat foo.c // SPDX-License-Identifier: GPL-2.0 int foo(int baz) { if (baz == 1) do_something(); } $ ./scripts/checkpatch.pl --file --terse foo.c foo.c:4: ERROR: trailing statements should be on next line total: 1 errors, 0 warnings, 6 lines checked thanks, greg k-h