lkml.org 
[lkml]   [2020]   [May]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/5] sysctl: remove all extern declaration from sysctl.c
Hi Christoph,

On Fri, 24 Apr 2020 08:43:36 +0200 Christoph Hellwig <hch@lst.de> wrote:
>
> Extern declarations in .c files are a bad style and can lead to
> mismatches. Use existing definitions in headers where they exist,
> and otherwise move the external declarations to suitable header
> files.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> include/linux/coredump.h | 4 ++++
> include/linux/file.h | 2 ++
> include/linux/mm.h | 2 ++
> include/linux/mmzone.h | 2 ++
> include/linux/pid.h | 3 +++
> include/linux/sysctl.h | 8 +++++++
> kernel/sysctl.c | 45 +++-------------------------------------
> 7 files changed, 24 insertions(+), 42 deletions(-)

A couple of suggestions for another patch (since this one is in a
shared branch in Al's tree now):

There is an "extern struct ctl_table random_table[];" in
drivers/char/random.c which is redundant now (in fact always was).

There is already an "extern struct ctl_table epoll_table[];" in
include/linux/poll.h, so could have included that in kernel/sysctl.c
instead of adding the new one in include/linux/sysctl.h

--
Cheers,
Stephen Rothwell
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2020-05-04 03:27    [W:1.471 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site