[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <77c24172a2fea727881ef4c4c901af7f3adecb4f.camel@perches.com>
Date: Thu, 30 Sep 2021 19:54:30 -0700
From: Joe Perches <joe@...ches.com>
To: Kees Cook <keescook@...omium.org>,
Randy Dunlap <rdunlap@...radead.org>
Cc: Jonathan Corbet <corbet@....net>,
Alexey Dobriyan <adobriyan@...il.com>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
linux-hardening@...r.kernel.org
Subject: Re: [PATCH v2] docs: Explain the desired position of function
attributes
On Thu, 2021-09-30 at 15:52 -0700, Kees Cook wrote:
> I have read and re-read Linus's emails, and did a frequency count in the
> kernel, and it looks like the preference is [return type] [return type attrs]
Please don't read too much into frequency counts as it really depends
on age of code.
> but I personally agree with you. :)
>
> # regex I built from __must_check hits...
> $ re='((struct .*|void|char) \* ?|((unsigned )?(long|int)|bool|size_t)($| ))'
>
> # type before __must_check
> $ git grep -E "$re"'__must_check' | wc -l
> 746
>
> # type after __must_check
> $ git grep -E '\b(static (__always_)?inline )?__must_check($| '"$re"')' | wc -l
> 297
Hmm.
$ git grep -w __must_check -- '*.[ch]' | wc -l
909
Powered by blists - more mailing lists