lkml.org 
[lkml]   [2023]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 6/7] fs/sysfs/group: make attribute_group pointers const
From
Date
On Tue, 2023-10-10 at 09:38 +0200, Max Kellermann wrote:
> On Tue, Oct 10, 2023 at 8:48 AM Joe Perches <joe@perches.com> wrote:
> > My opinion is that const use in the kernel should almost
> > always have whitespace before and after it except when
> > preceded by a open parenthesis or a newline.
>
> So it shall be "void * const foo" (16k occurrences in the kernel)
> instead of "void *const foo" (3k occurrences)?

I think so.

$ git grep -P -oh "\bconst\s*\*" | sort | uniq -c | sort -rn | head -3
2538 const *
349 const*
20 const *
$ git grep -P -oh "\*\s*const\b" | sort | uniq -c | sort -rn | head -3
16677 * const
2912 *const
8 * const

Documentation/process/coding-style.rst doesn't mention const.
Maybe it should.

\
 
 \ /
  Last update: 2023-10-10 10:02    [W:0.056 / U:0.652 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site